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.

Our next available supporter will start replying to tickets in about 1.26 hours from now. Thank you for your understanding.

This topic contains 4 replies, has 2 voices.

Last updated by piotrB-18 5 months, 1 week ago.

Assigned support staff: Noman.

Author Posts
May 15, 2019 at 10:39 am #3815025

piotrB-18

How to add language switcher in menu mobile phone?
as in the picture in attachment.

Best regards

May 15, 2019 at 10:47 am #3815101

piotrB-18

as in the picture in attachment.

May 15, 2019 at 11:55 am #3815945

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting WPML Support. The possibility to add your language switcher on that position depends on your theme. Does your theme provides you the option to add a content (for example a widget) or some code exactly on the position that you wish?

You can use below code to show custom language switcher on specific position:

do_action('wpml_add_language_selector');

Here is doc for custom language switcher:
https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/#custom-locations

Please let me know if this resolves your issue or you need further assistance with this issue.

Thank you

May 15, 2019 at 12:56 pm #3816595

piotrB-18

Ok i added. But the dropdown language switcher is a hover dropdown. If i can click on the mobile phone language switcher is hurry up redirect me in first language. In the mobile phone must be clicable dropdown language switcher. I add other div id="languagephone". How to set only mobile phone language switcher clicable dropdown?

Best regards

May 15, 2019 at 3:35 pm #3818431

piotrB-18

My issue is resolved now. Thank you!

I can add to header.php

<div class="topbar-lang-switcher" id="languagephone">
						<?php echo do_shortcode('[wpml_language_switcher type="widget" flags=1 native=1 translated=0][/wpml_language_switcher]'); ?>
						</div>

and i can add custom css

@media (min-width: 770px) {
	#languagephone {
		display: none;
	}
}

#languagephone.topbar-lang-switcher ul li {
	max-height: 230px!important;
}

#languagephone li {
	display: block;
	width: 100px;
}

#languagephone.topbar-lang-switcher {
	float: left!important;
	margin: 10px!important;
}