Title: Conditional WPML Language selector placement
Last modified: October 27, 2016

---

# Conditional WPML Language selector placement

 *  [Arifi Koseoglu](https://wordpress.org/support/users/woodstitcher/)
 * (@woodstitcher)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/conditional-wpml-language-selector-placement/)
 * Hi,
    I am using WPML, Woocommerce and the Storefront theme to create a multilanguage
   site.
 * After fiddling with the configuration options of WPML for a while, I decided 
   I would use the
 * `<?php do_action('wpml_add_language_selector'); ?>`
 * line to display the language switcher above the standard search field of Storefront.
   For this I edited the inc/woocommerce/storefront-woocommerce-template-functions.
   php file like this:
 *     ```
       	function storefront_product_search() {
       		if ( is_woocommerce_activated() ) { ?>
       			<div class="site-search">
       /** MAK BEGIN **/
       				<?php do_action('wpml_add_language_selector'); ?> 
       /** MAK END **/
       				<?php the_widget( 'WC_Widget_Product_Search', 'title=' ); ?>
       			</div>
       		<?php
       		}
       	}
       ```
   
 * (Let’s not worry about child themes, etc please.)
 * This works fine on desktop screens.
 * However, whenever the site is displayed on a mobile screen or in a narrow browser
   window, the theme switches to mobile layout as expected, and the language selector
   goes to an unusable location, actually still obeying the code and displaying 
   itself above the search area, which now is at the very bottom of the screen, 
   resulting in an unusable selector.
 * Could you please help me in finding out what to do in order to display the language
   selector on top of the search field only when the normal layout is active, and
   somewhere more usable (like in the toplevel menu?) on mobile layout?
 * Best regards
    Arifi Koseoglu

The topic ‘Conditional WPML Language selector placement’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/storefront/4.6.2/screenshot.png)
 * Storefront
 * [Support Threads](https://wordpress.org/support/theme/storefront/)
 * [Active Topics](https://wordpress.org/support/theme/storefront/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/storefront/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/storefront/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Arifi Koseoglu](https://wordpress.org/support/users/woodstitcher/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/conditional-wpml-language-selector-placement/)
 * Status: not resolved