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