PHP snippet not executing polylang
-
I am using Polylang on Local developed wordpress website. I am trying to create a shortcode and later invoke it for Polylang flags with slugs in Neve theme header.
This is my code:
<?php function polylang_shortcode() { ob_start(); pll_the_languages(array(‘show_flags’=>1,’show_names’=>1,‘display_names_as’ => ‘slug’)); $flags = ob_get_clean(); return $flags; } if (function_exists('pll_the_languages')) { add_shortcode(‘polylang’, ‘polylang_shortcode’); }; ?>I invoke it with [polylang], but it does nothing but print exact string, “[polylang]”.
Does anyone know what to do?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘PHP snippet not executing polylang’ is closed to new replies.