7 thoughts on “the flags don’t show up…

  1. support admin Post author

    Are you sure this theme and you are using the wp_nav_menu (appearence -> menus) ?

    Reply
  2. Simon

    Ok, I found the problem.

    Only when using a custom menu do the flags appear.
    I do not know if it is to do with the theme or the way wordpress works.

    Please add a clause about this in the plugins description.

    and another thing, I fixed the behavior of the flag positioning for rtl languages,
    please update the code for other peoples use.


    function plugin_wpml_flag_in_menu($items, $args = NULL)
    {
    if(function_exists('icl_get_languages'))
    {
    $new_items = '';
    $languages = icl_get_languages('skip_missing=0&orderby=code');
    if(!empty($languages)){
    foreach($languages as $l){
    // Exclude current viewing language
    if($l['language_code'] != ICL_LANGUAGE_CODE)
    {
    $new_items .= '';
    if(!$l['active']) $new_items .= '';
    if($l['country_flag_url']){
    $new_items .= '';
    }
    // $new_items .= icl_disp_language($l['native_name'], $l['translated_name']);
    if(!$l['active']) $new_items .= '
    ';
    $new_items .= '';
    }
    }
    }

    // Place the flags at the correct side of the menu according to the the language direction
    if (is_rtl())
    {
    $items = $new_items.$items;
    } else {
    $items .= $new_items;
    }
    }
    return $items;
    }
    ?>

    Thank you very much!
    Simon

    Reply
    1. support admin Post author

      Hi Simon,

      thanks for your LTR Code, I will implement it tomorrow as a new version.

      Conserning your remark about usage .. if you use appearence -> menus then this plugin will be “present”. Was that the case?
      This is called wp_nav_menu. I will adapt the description.

      Reply

Leave a Reply

Your email address will not be published.