Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

zeshark on "[Plugin: Polylang] Conditional language switcher display"

$
0
0

It WORKS !
Thanks a million, I really appreciate the help.

For the convenience of others, the final code: this displays in the div only the available language(s), and no div if there is no translation available.

<?php
$switcher = pll_the_languages( array(
	'show_flags'=>1,
	'show_names'=>1,
	'force_home'=>0,
	'hide_if_no_translation'=>1,
	'hide_current'=>1,
	'echo' => 0
) );
if($switcher): ?>
<div id="LanguageSwitcher" class="styleLanguageSwitcher" >
<ul><?php echo $switcher ?></ul>
</div>
<?php endif; ?>

Viewing all articles
Browse latest Browse all 11471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>