Title: Help!Display flags only
Last modified: September 5, 2017

---

# Help!Display flags only

 *  [moorsanna](https://wordpress.org/support/users/moorsanna/)
 * (@moorsanna)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/helpdisplay-flags-only/)
 * Hi there, I would like to display the two optional flags instead of languages
   and then the drop down menu.
    Sorry, I am a newbie!! So e.g. you are on the spanish
   site, I’d like to see only the german and english flag to be able to choose from.
   I have found this: <!– outputs a flags list (without languages names) –>
    -  <?php pll_the_languages( array( ‘show_flags’ => 1,’show_names’ => 0 ) ); ?
      >
 * Important: You have to output yourself the ul tags if you don’t use the dropdown
   option
    Also what does this mean: IMPORTANT: when using one or more of these 
   function, you *must* check for its existence before using it, otherwise your 
   site will badly break with a fatal error at next Polylang update (as WordPress
   deletes the plugin when updating it). Is this what I want and if yo, where and
   how do I implement this please? Because in the backend of the plugin, I can not
   see any settings. Thank you!!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhelpdisplay-flags-only%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 11 replies - 1 through 11 (of 11 total)

 *  [ivanbel](https://wordpress.org/support/users/ivanbel/)
 * (@ivanbel)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/helpdisplay-flags-only/#post-9471520)
 * Hi,
    This is interesting. In which file did you find the way to get the flags
   appearing? I’m desepratly looking for that. Thanks. Ivan
 *  Thread Starter [moorsanna](https://wordpress.org/support/users/moorsanna/)
 * (@moorsanna)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/helpdisplay-flags-only/#post-9472123)
 * Hey [@ivanbel](https://wordpress.org/support/users/ivanbel/) ,
    I just sported
   everything out in the WP-backend in the plugins settings, you choose the language
   and the according flag. The only thing I changed, since I did not want the current
   language displayed was this: #site-navigation .current-lang { display: none; }
   In your case the issue for the flags not displaying might be this: “It is quite
   frequent that theme developpers forget that plugins can add images in menu items
   and thus create custom walkers which do not interpret the html code used by Polylang
   to display flags.” Not sure if this helps…as said, I really would like to display
   just the other two options in the menu….in case anyone has any ideas?? 😉
    -  This reply was modified 8 years, 9 months ago by [moorsanna](https://wordpress.org/support/users/moorsanna/).
 *  [ivanbel](https://wordpress.org/support/users/ivanbel/)
 * (@ivanbel)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/helpdisplay-flags-only/#post-9472286)
 * Hello @Moorsana,
    Thank you for the css code. [@all](https://wordpress.org/support/users/all/)
   Don’t you think it would be possible to add a css code to force displaying the
   flags, like (I don’t know if that do exist.
 * #site-navigation .current-flag{
    display: 1; }
 * My current template is twenty seventeen, the basic wordpress that is included.
 *  Thread Starter [moorsanna](https://wordpress.org/support/users/moorsanna/)
 * (@moorsanna)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/helpdisplay-flags-only/#post-9492193)
 * Cheers for the idea, the thing is, I do not want the menu item “languages”, but
   jut the two flag options displayed…. 😉
 *  [ivanbel](https://wordpress.org/support/users/ivanbel/)
 * (@ivanbel)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/helpdisplay-flags-only/#post-9492219)
 * That’s exactly what I want too, but noone seems to be able to answer that question…
 *  anonymized-13603639
 * (@anonymized-13603639)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/helpdisplay-flags-only/#post-9492390)
 * Guys, there is no clickable build in function to show only flags.
    The answer
   and code, postet by [@moorsanna](https://wordpress.org/support/users/moorsanna/),
   is the right and only way to get this done. You need knowledge regarding WordPress,
   Child Theme, PHP, HTML and CSS to achieve this. A general code snippet will no
   help because each theme has different ways where to display flags and how to 
   use CSS.
 *  [ivanbel](https://wordpress.org/support/users/ivanbel/)
 * (@ivanbel)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/helpdisplay-flags-only/#post-9492410)
 * @lachender_engel
 * Thank you for your answer. So if you understand you right, we have to put this
   string :
    <?php pll_the_languages( array( ‘show_flags’ => 1,’show_names’ => 0));?
   >
 * But where? In which file?
 *  anonymized-13603639
 * (@anonymized-13603639)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/helpdisplay-flags-only/#post-9492569)
 * [@ivanbel](https://wordpress.org/support/users/ivanbel/) Depens on where oyu 
   want to display the flags.
    As I wrote, there is no general answer which works
   for everybody. It depens on the theme. If you want to show the flags in the header,
   you have to add this at the right place in header.php. If oyu want to show it
   in the footer, you need to edit footer.php. But, before you do this, you have
   to create a Child Theme.
 * As I wrote, it is nothing out of the box which is working for everybody.
 *  [ivanbel](https://wordpress.org/support/users/ivanbel/)
 * (@ivanbel)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/helpdisplay-flags-only/#post-9493318)
 * Otherwise, when it’s working
    1- go to Appearance/Menu 2- in your menu you should
   have “list of languages”. Open it. 3- check “Display flags only”
 *  [ivanbel](https://wordpress.org/support/users/ivanbel/)
 * (@ivanbel)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/helpdisplay-flags-only/#post-9495694)
 * I think we can close this thread.
 *  Thread Starter [moorsanna](https://wordpress.org/support/users/moorsanna/)
 * (@moorsanna)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/helpdisplay-flags-only/#post-9496054)
 * Hey @lachender_engel and [@ivanbel](https://wordpress.org/support/users/ivanbel/),
 * in my backend for some reason I do not have this option:
    1- go to Appearance/
   Menu 2- in your menu you should have “list of languages”. Open it. 3- check “
   Display flags only”
 * Anyhow, I am working with a child theme of spacious, and would like to implement
   this:
    <?php pll_the_languages( array( ‘show_flags’ => 1,’show_names’ => 0 ) );?
   > The question is, I can not figure out how the languages dropdown link gets 
   into my menu, there is no menu options in the plugin backend neither in the WP
   menu nor the theme menu. I am desperately trying to find the right php file where
   to put the above code, to only display the two flags without a dropdown link 
   that states “languages”. Sorry for being a pain.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Help!Display flags only’ is closed to new replies.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

## Tags

 * [header](https://wordpress.org/support/topic-tag/header/)
 * [menue](https://wordpress.org/support/topic-tag/menue/)
 * [no-dropdown](https://wordpress.org/support/topic-tag/no-dropdown/)

 * 11 replies
 * 3 participants
 * Last reply from: [moorsanna](https://wordpress.org/support/users/moorsanna/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/helpdisplay-flags-only/#post-9496054)
 * Status: not resolved