[Resolved] Language switcher is not displayed on PC view
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is trying to display the WPML language switcher on their website using the Porto theme. It appears correctly on mobile devices but not on the PC view. Solution: If you're experiencing this issue, we recommend disabling the Porto language switcher in the theme options. You can find instructions on how to do this here: Porto Theme Options. To use the WPML official language switcher, you should add it to your header PHP code via shortcode. This can be done using the Elementor option within Porto to build the header and then adding the WPML shortcode. For detailed guidance on adding language switchers using PHP and shortcodes, please visit: Adding Language Switchers Using PHP and Shortcodes. Additionally, you may consult Porto theme support for specific instructions on where to add this shortcode in the header.php file.
If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at WPML Known Issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Should you need further assistance, please open a new support ticket at WPML Support Forum.
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.
Background of the issue:
I am trying to display the language switcher on my website, hidden link, using WPML. It appears correctly on mobile devices but not on the PC view.
Symptoms:
The language switcher is not displayed in the main menu on PC view, but it displays normally on mobile.
Questions:
Is there a way to display the language switcher on PC mode?
make sure you have added language switcher to the correct PC menu, if needed create and add another one. You can do that from WPML > Languages > Menu Language switcher:
You will see this in the responsive display correctly.
You will notice that the page also shows the flag in its code, but it doesn't appear for some reason.
I was able to show it with a setting that the theme(Porto) had, but I still have a display problem.
I just want the flag to appear on the menu.
While I have the correct settings in WPML, it is still not displaying correctly.
that is not possible for dropdown option as you can probably see from language swticher option. You need to select list of languages and select to use only flag, image attached.
- Please backup the site files and database before providing us access.
- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.
thanks, I have checked and you are using the Porto header builder and Porto language switcher, which you can disable in theme options: hidden link
Other than that if you wish to use the WPML official language switcher and adjust it, you will need to add it to your header PHP code via shortcode or to your header, since Porto already uses it own language switcher and WPML can not show it own there.
I advise you to use the Elementor option from Porto to build the header builder and there add your WPML shortcode and enable the custom language switcher and it should work and show fine.