Last active
October 15, 2018 16:33
-
-
Save mafsdisseny/c199d37a292a0ebcf1aa to your computer and use it in GitHub Desktop.
Polylang language switcher with slugs, uses Genesis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Add language switcher polylang with slug inspite of names | |
//* Position header-right | |
add_action( 'genesis_header_right', 'custom_language_switcher'); | |
function custom_language_switcher() { | |
echo '<ul class="custom-lang-switcher">'; | |
pll_the_languages(array('show_names'=>1,'display_names_as'=>'slug')); | |
echo '</ul>'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ul.custom-lang-switcher { | |
display: inline-block; | |
border-right: 1px solid; | |
font-size: $font-size-S; | |
li { | |
float: left; | |
margin-right: 15px; | |
border-left: 1px solid; | |
padding-left: 15px; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment