Language Swtcher – Show /Hide in Sidebar
-
How can I code the switcher to show/hide in the sidebar? We need to code it directly in the template with a wrapper around it. Not in the widgets. Can you help me finish this IF Else statement please?
<?php
if ( ????? ) { // if translation exists show language switcherif (get_locale() == ‘en_US’) {
echo ‘<section class=”widget widget-related-content custom-sidebar”><h3>Translation</h3>- ‘;
} else {
echo ‘<section class=”widget widget-related-content custom-sidebar”><h3>’.pll__(‘Translation’).'</h3>- ‘;
}
pll_the_languages(
array(‘show_flags’=>1,
‘show_names’=>1,
‘hide_current’=> 1,
‘hide_if_empty’ => 1,
‘force_home’ => 0,
‘hide_if_no_translation’ => 1));
echo ‘</section>’;
} else {
// DO NOT SHOW ANYTHING
}
?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Language Swtcher – Show /Hide in Sidebar’ is closed to new replies.