Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 5 replies, has 2 voices.

Last updated by Bobby 3 years, 3 months ago.

Assigned support staff: Bobby.

Author Posts
April 27, 2017 at 3:39 am #1262845

mohamedl

I am trying to:

URL of (my) website where problem appears: macman

I expected to see: language switcher in the menu

Instead, I got: "wpml-ls-flag" src"hidden link" alt"en" title"English">English »

Steps to duplicate the issue: add a language switcher to menu after install

April 27, 2017 at 5:24 am #1262866

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

This is a theme related issue due to theme using custom menu walker and some hooks to decode characters in menu items.

Our compatibility team is currently working on the issue, however in meanwhile could you please do following to fix the issue? This will be a temporary workaround to fix the issue.

Please go to /bazar/core/lib/yit/walker/Walker_Nav_Menu.php

line 83 change this line of code

else {
            $item_output .= '<a'. $attributes .'>';
        $item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append;
        $item_output .= $args->link_after;
            $item_output .= '</a>';            
        }

to

else {
            $item_output .= '<a'. $attributes .'>';
 
            if( $item->type == 'wpml_ls_menu_item' ){
                $item_output .= $args->link_before. $prepend . $item->title . $append .$args->link_after;
            }else{
                $item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append;
                $item_output .= $args->link_after;
            }
             
            $item_output .= '</a>';            
        }

Save and upload.

Let me know your results . ( i have test this on my local install and it worked)

April 27, 2017 at 10:40 am #1263164

mohamedl

better now but still event with code to remove to white/empty space whether in the widgets or menu doesn't work still
thanks

April 27, 2017 at 4:24 pm #1263596

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

Did replacing the code above fix the issue with the language switcher showing in the HTML code in the front end ?

April 27, 2017 at 7:23 pm #1263774

mohamedl

yes it did, but still have some empty space in the widgets for language/currecny switcher

is it possible to fix that as well thanks

April 27, 2017 at 11:14 pm #1263875

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

That space is controlled by your theme's CSS and not WPML, i suggest contacting your theme author as they know their CSS code best.

In addition i did notice that this request is currently being looked at within a seperate thread.

May i kindly ask you to please mark this thread here as resolved since the original issue
"language switcher showing a weird error" has been resolved , this will help keep all issues organized as we ask to have only one topic per each support ticket

Thank you ,
Bobby