Title: [Plugin: Polylang] Flags vs. Text Links in widget
Last modified: August 20, 2016

---

# [Plugin: Polylang] Flags vs. Text Links in widget

 *  [Christian Ries](https://wordpress.org/support/users/christian-ries/)
 * (@christian-ries)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/)
 * Hi Chouby,
    I’m testing all the multilingual features of WP with theme 20/11 
   and your plugin is the first that works completely, including links between pages,
   posts, categories and in the menues. Thanks a lot for this perfect solution where
   the user is still master over every detail. I have a request for the wish-list:
   would it be possible to show the language switcher as flags in the sidebar widget?

Viewing 15 replies - 1 through 15 (of 35 total)

1 [2](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/page/2/?output_format=md)

 *  [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/#post-2384113)
 * It’s on my roadmap, either in v0.4 or in v0.5 depending on the date I will release
   the v0.4
 *  Thread Starter [Christian Ries](https://wordpress.org/support/users/christian-ries/)
 * (@christian-ries)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/#post-2384118)
 * Thank you Chouby for your fast reply.
 *  [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/#post-2384166)
 * Finally I included it in v0.4
 *  Thread Starter [Christian Ries](https://wordpress.org/support/users/christian-ries/)
 * (@christian-ries)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/#post-2384167)
 * Thank you Chouby, but it works only partly (see [http://byfoot.eu/bivels-lu/?page_id=29](http://byfoot.eu/bivels-lu/?page_id=29)
   as a temporary example) and I didn’t find a place where to switch between text/
   flags / flags & text…
    But maybe I made some mistake.
 *  [yoyurec](https://wordpress.org/support/users/yoyurec/)
 * (@yoyurec)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/#post-2384168)
 * there is error in polylang.php, function **the_languages**
 * `'<li class="'.$class.'"><a href="'.$url.'">'.($show_flags && $show_names ? $
   flag.'&nbsp;'.$name : $flag.$name)."</a></li>\n";`
 * flags shows even when you set doesn’t to show.
    must be:
 * `'<li class="'.$class.'"><a href="'.$url.'">'.($show_flags && $show_names ? $
   flag.'&nbsp;'.$name : $name)."</a></li>\n";`
 *  [yoyurec](https://wordpress.org/support/users/yoyurec/)
 * (@yoyurec)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/#post-2384169)
 * dropdown list doesn’t switch languages. to options tag value we can add url and
   to select tag js-redirect to **onchange** event:
 *     ```
       $output = $dropdown ? '<select name="lang_choice" id="lang_choice" onchange="window.location.href=this.options[this.selectedIndex].value">' : "<ul>\n";
       ```
   
 *     ```
       sprintf(
       					"<option value='%s'%s>%s</option>\n",
       					$url,
       					$language->slug == $this->curlang->slug ? ' selected="selected"' : '',
       					$name // FIXME flag does not work for the dropdown list
       				) :
       ```
   
 *  [yoyurec](https://wordpress.org/support/users/yoyurec/)
 * (@yoyurec)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/#post-2384170)
 * so with this 3 little bugfixes code should looks like this:
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 *  [yoyurec](https://wordpress.org/support/users/yoyurec/)
 * (@yoyurec)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/#post-2384171)
 * > so with this 3 little bugfixes code should looks like this:
   >  [….]
 * full code here – [http://pastebin.com/qtdS5hqd](http://pastebin.com/qtdS5hqd)
 *  [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/#post-2384180)
 * Thank you for your feedback.
 * I will correct the flags issue in the future release.
 * For the dropdown list, I guess that you use directly the function ‘the_language’
   and not the widget. The javascript is included in the widget and intentionally
   not in the ‘the_language’ function, just as it is done in WordPress with the 
   categories widget and the ‘wp_dropdown_categories’ function. I suppose that the
   widget is for users that want something ready to use and the function is for 
   users that want more flexibility but are ready to write some code. Maybe I will
   do something different in the future to improve this (with an additional option
   in the function ?).
 *  [The Crazy Travel](https://wordpress.org/support/users/sh4dowsoul/)
 * (@sh4dowsoul)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/#post-2384212)
 * Now that it’s corrected the flag thing, how do I configurate if I don’t have 
   any clue? 😛
 *  [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/#post-2384213)
 * The problem detected by yoyurec was that flags were displayed even if the language
   switcher was requested not to show them. It is solved now.
 * What do you want to do ?
 *  [The Crazy Travel](https://wordpress.org/support/users/sh4dowsoul/)
 * (@sh4dowsoul)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/#post-2384214)
 * I want to turn on the flags, where I have to upload the images for the flags?
   which name have they to have? any concrete size or as I prefer? How they will
   appear? In front of the text? Can I put them in a line instead of in a row? 😛
 *  [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/#post-2384215)
 * I wrote some things about that in the documentation that you can find in the “
   polylang/doc” directory.
 * To turn on the flags, just check the “display flag” option in the widget. You
   may want to check or uncheck the “display name” option. To use custom flags, 
   just upload them in “polylang/local_flags” directory. You must name them en_US.
   png or en_US.jpg (or the appropriate locale for other languages). The size is
   yours. The html code outpusts the flag before the name.
 * The way they are displayed (in a line or in a row) is just set by your css rules.
   You can play with `.lang-item {display: inline;}` or other css rules on the same
   class to modify the appearance
 *  [The Crazy Travel](https://wordpress.org/support/users/sh4dowsoul/)
 * (@sh4dowsoul)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/#post-2384216)
 * Where I find .lang-item {display: inline;}? :$
 * if you check miesquinica.com you will see the icons for the languages, and I 
   would want to put that in line one after other without anything else than images.
 *  [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/#post-2384217)
 * I intentionally did not set any css rule (for frontend) in the plugin. It’s up
   to the theme to do that.
 * You can write this line for example at the bottom of your file style.css in your
   theme.

Viewing 15 replies - 1 through 15 (of 35 total)

1 [2](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/page/2/?output_format=md)

The topic ‘[Plugin: Polylang] Flags vs. Text Links in widget’ is closed to new replies.

## Tags

 * [flags](https://wordpress.org/support/topic-tag/flags/)

 * 35 replies
 * 8 participants
 * Last reply from: [Chouby](https://wordpress.org/support/users/chouby/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-polylang-flags-vs-text-links-in-widget/page/3/#post-2384308)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
