1

I want to create a drop-down menu in my site header. I use this code:

<ul class="lang" id="top-lang">
  <li class="pll-parent-menu-item"><a href="#pll_switcher"><?php echo pll_current_language( 'name' ) ?></a> 
    <ul class="sub-menu">
     <?php if(function_exists('pll_the_languages')){ 
        pll_the_languages(array('display_names_as' => 'name', 'hide_current' => 1, 'show_flags'=>1)); 
     } ?> 
    </ul>
  </li>
</ul>

But I don't understand why, the current language is output without a flag.

I thought maybe I could just display a list of languages, but it's not clear how to make the active language appear in the title of the drop-down menu

Cédric
  • 2,239
  • 3
  • 10
  • 28
Vladimir
  • 11
  • 1

1 Answers1

0

you have 'hide_current' => 1 set which hides the current language if set to 1 (true). by default it is set to 0 (false).

Moishy
  • 3,560
  • 3
  • 23
  • 42