-
-
Save f7en/4a91e070041fa62bd636 to your computer and use it in GitHub Desktop.
Polylang Shortcode
This file contains hidden or 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
// Polylang Shortcode - https://wordpress.org/plugins/polylang/ | |
// Add this code in your functions.php | |
// Put shortcode [polylang] to post/page for display flags | |
function polylang_shortcode() { | |
ob_start(); | |
pll_the_languages(array('show_flags'=>1,'show_names'=>0)); | |
$flags = ob_get_clean(); | |
return $flags; | |
} | |
add_shortcode( 'polylang', 'polylang_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment