Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #769820

    We have altogether three languages. German language is not translated with the plugin Polylang, it is a separate site.
    How can I have this language (site) appearing inside the language selector that it looks equal to the other languages but is linked to an other site (other server)

    i have this code from WPML support forum that i think it would work but it needs a little modification…can you please help me and modify so it would work with enfold and polylang

    add_filter(‘wp_nav_menu_items’, ‘new_nav_menu_items’, 10, 2);
    function new_nav_menu_items($items, $args) {
    if (function_exists(‘icl_get_languages’)) {
    $items = “”;
    $languages = icl_get_languages(‘skip_missing=0’);
    if(1 < count($languages)){
    foreach($languages as $l){
    if( $l[‘language_code’] == ‘de’ ) { //if the external language is de.
    $items = $items.'<span class=”menu-item-‘.$l[‘language_code’].'”> ‘ . ‘</span> ‘;
    else {
    $items = $items.'<span class=”menu-item-‘.$l[‘language_code’].'”> ‘ . ‘</span> ‘;
    return $items;

    • This topic was modified 7 years, 3 months ago by Uros.

    Hey Uroš,

    Could you please add this code using the code button, so that it gets pasted correctly and
    could you please give us a link to your website, we need more context to be able to help you.

    Best regards,


    i work around and solve problem with another method…thank you anyway



    Great, glad you found a solution. Please open a new thread if you should have any further questions or problems.

    Best regards,

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Apply external link to a language flag inside language selector’ is closed to new replies.