Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27546

    I know breadcrumb is made dynamically from avia – as all the post says, and you cant get rid of it except thru css-display:none. but it would be the perfect place for the language selector form WPML. Is there any way to replace breadcrumb with the selector? – maybe somewhere in the avia-code? <?php do_action(‘icl_language_selector’); ?>

    thanx

    #134372

    Try following – open up functions-enfold.php and at the very end of the file insert

    if(!function_exists('avia_wpml_language_switch_return'))
    {
    function avia_wpml_language_switch_return()
    {
    $languages = icl_get_languages('skip_missing=0&orderby=custom');
    $output = "";

    if(is_array($languages))
    {
    $output .= "<ul class='avia_wpml_language_switch'>";

    foreach($languages as $lang)
    {
    $currentlang = (ICL_LANGUAGE_CODE == $lang['language_code']) ? 'avia_current_lang' : '';

    $output .= "<li class='language_".$lang['language_code']." $currentlang'><a href='".$lang['url']."'>";
    $output .= " <span class='language_flag'><img title='".$lang['native_name']."' src='".$lang['country_flag_url']."' /></span>";
    $output .= " <span class='language_native'>".$lang['native_name']."</span>";
    $output .= " <span class='language_translated'>".$lang['translated_name']."</span>";
    $output .= " <span class='language_code'>".$lang['language_code']."</span>";
    $output .= "</a></li>";
    }

    $output .= "</ul>";
    }

    return $output;
    }
    }

    Then replace

    if($breadcrumb) $additions .= avia_breadcrumbs(array('separator' => '/', 'richsnippet' => true));

    with

    if($breadcrumb) $additions .= avia_wpml_language_switch_return();

    #134373

    works perfect, thanx

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘language selector instead of breadcrumb’ is closed to new replies.