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

Last updated by Robert 5 years, 5 months ago.

Assigned support staff: Ankit.

Author Posts
April 27, 2015 at 1:57 pm #606980



Two questions which I can't seem to wrap my head around. I updated the flatsome theme and plugins on for security reasons.

Question 1 regarding language switcher php code:

		<div id="top-bar">
			<div class="row">
				<div class="large-12 columns">
					<!-- left text -->
					<div class="left-text left">
						<div class="html"><?php echo do_shortcode( $flatsome_opt['topbar_left']);?></div><!-- .html -->
					<!-- top bar right -->
<div class="langselect">
<?php language_selector_flags(); ?>
					<div class="right-text right">
							<ul id="menu-top-bar-menu" class="top-bar-nav">
									if ( has_nav_menu( 'top_bar_nav' ) ) :

in header.php I have entered the language selector. After updating theme files it suddenly does not load the page after inserting this line of code. In my experience this happens when there's a </div> tag too many or <?php tag missing. But I can't seem to see what is wrong about this?

Question 2:
On page: hidden link it shows the Chinese products just fine although can't open the (chinese) product pages, they show 404. English products open fine without problems.
So there's two links for the Chinese products and both don't work
link1 shown when editing product: hidden link
link2 show on product page: hidden link. Which contains Chinese characters.

Many thanks in advance


April 28, 2015 at 12:25 am #607366


Question 2 is resolved by selecting "Product" in settings>permalink.

Now I still need my flags in the top header 🙂 Thanks

April 28, 2015 at 11:50 am #607768


Hi Robert,

Thank you for contacting support forum.

1. I believe that second issue mentioned by you has been resolved, so I will be trying to answer your first issue related to language switcher.

Can you please do following for me ?

From the snippet provided by you it seems that you are using following function to display language switcher.

<?php language_selector_flags(); ?>

Please replace above line by following code in your snippet and confirm if it still breaks your page ?

	if( function_exists('language_selector_flags') ) {

This is to confirm that the above function being used in theme exists or not?

If above function does not exists in your theme then you may have to add this function in order to display the switcher.

Similar function definition (code) is available at: under "Language selector with flags only" section.

Let me know if this helps.


April 28, 2015 at 12:18 pm #607800


Ah yes, I had this function in function.php before updating the theme. I assumed it was already an existing function of WPML.

Thanks for your help Ankit. Now I know for next time what to do when this happens.