Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author crazypsycho

    (@crazypsycho)

    Hi @boombalaya,

    Elementor itself doesn’t offer a DynamicTag for the current language, but you could use our DynamicTag plugin and select Current Language as the tag.
    https://ww.wp.xz.cn/plugins/dynamictags/

    nicmare

    (@nicmare)

    or build your own shortcode and compare the rule against that shortcode. in my case i do it with polylang

    if(!function_exists("get_lang")){
        function get_lang($short=false){
            $lang = get_locale();
            if(empty($lang)) $lang = "en_US";
            if(function_exists("pll_current_language")) $lang = pll_current_language("locale");
            if($short == true) $lang = substr( $lang, 0, 2 );
            return $lang;
        }
    }
    function get_lang_shortcode(){
    	if(function_exists("get_lang")) {
    		return get_lang(true);
    	}
    	return "";
    }
    add_shortcode("get_lang","get_lang_shortcode");
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding site’s current locale as condition’ is closed to new replies.