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

mirilailai on "Polylang shortcode (like qTranslate) for theme options and text"

$
0
0

I add `function polylang_shortcode($atts, $content = null)
{
if (empty($content))
return '';
extract( shortcode_atts( array('lang' => ''), $atts ) );
if (empty($lang))
return "<h3>You must specify 'lang' using shortcode: polylang</h3>";

return ($lang == pll_current_language()) ? $content : '';
}
add_shortcode('polylang', 'polylang_shortcode');`

and it pulls me an error: Fatal error: Cannot redeclare polylang_shortcode() (previously declared in /home/meliaspa/www/www/wp-content/plugins/polylang/polylang.php:33) in /home/meliaspa/www/www/wp-content/themes/spa/functions.php on line 11 when I save..


Viewing all articles
Browse latest Browse all 11471

Trending Articles



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