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 8 replies, has 2 voices.

Last updated by Bruno 5 years, 4 months ago.

Assigned support staff: Bruno.

Author Posts
May 5, 2015 at 8:19 am #611883

Dimitri

Hi,

I've added the languageswither to a wordpress menu, but I'd like to position it as the last item of the menù.
In other words I'd like to force its order.

Thank you.

D.

May 5, 2015 at 7:12 pm #612594

Bruno

Usually the language selector is added as the last item of the menu.

Please, what is the version of WPML and WP are you using? I would like to know more about you installation. Can you please provide your WPML Debug information in the debug field below? http://wpml.org/faq/provide-debug-information-faster-support/

Thank you.

May 6, 2015 at 8:11 am #612866

Dimitri

Hi,

here you are my debug information.

D.

May 6, 2015 at 12:47 pm #613180

Bruno

The version, 3.1.9.6, was released. Please could you update? If you have registered your site, you can update from the WordPress dashboard.

If not, please, log into your client area and download the latest version ( https://wpml.org/account/downloads/ ). Then extract the files on your computer and with FTP replace the old files on your server (wp-content/plugins/).

Please make a full backup of your site before upgrading WPML.

Please let me know if this solves the problem and if I can help with anything else.

Thank you.

May 7, 2015 at 10:30 am #613983

Dimitri

Hi,

actually it's still there..

D.

May 7, 2015 at 2:00 pm #614230

Bruno

You want the language selector stay after the item "My Bag"? You are using some custom function to add the language selector in the menu?

Thank you.

May 7, 2015 at 3:47 pm #614344

Dimitri

Yes, I want the language selector at the end.

To add the language selector in the menù I've used the WPML back-end options.

May 7, 2015 at 8:24 pm #614528

Bruno

I need to request temporary access (wp-admin and FTP) to your site - preferably to a test site where the problem has been replicated if possible - in order to be of better help.

You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Please let me know exactly what steps should I follow to see the problem.

Note: Please make a full backup of your site.

Thank you.

May 8, 2015 at 7:49 pm #615401

Bruno

I added this function on the functions.php file of your theme:

//add custom flags
add_filter('wpmenucart_menu_item_wrapper','wpml_add_custom_menu');
function wpml_add_custom_menu( $menu_item_li ) {

	$languages = icl_get_languages('skip_missing=1');

    if( count( $languages ) > 1 )  {
    	foreach($languages as $language) {
    		if(!$language['active'])
    			$items .= '<li class="menu-item menu-item-language"><a href="'.$language['url'].'"><img src="'.$language['country_flag_url'].'" alt="'.$language['native_name'].'" /> '.$language['native_name'].'</a></li>';
    	}
    }

    return $menu_item_li.$items;
}

On the WPML > Languages > Language switcher options, I unchecked the 'Display the language switcher in the WP Menu' option.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Thank you.

The topic ‘[Closed] Language swithcer in wp menu change position order’ is closed to new replies.