Hi, i`m trying to get this working on enfold, but isn´t showing nothing if i use condition for language:
function enfold_customization_add_to_header() {
if(get_locale() == 'en_en') {
echo do_shortcode("[av_button label='Book' link='manually,https://mydomain.com/test/' link_target='' size='large' icon_select='no' icon='ue800' font='entypo-fontello' font-size='0.1em' custom_class='bookbtn']");
}
if(get_locale() == 'es_es') {
echo do_shortcode("[av_button label='Reservar' link='manually,https://mydomain.com/test/' link_target='' size='large' icon_select='no' icon='ue800' font='entypo-fontello' font-size='0.1em' custom_class='bookbtn']");
}
}
I was trying with es_es en_gb en only, etc…
Well, i`m sorry, its working if i use es_ES like this, but, this is a bit hard to configure it for any locale.
I`m using WPML translate, can i check if im using in url /en/ or /es/ ?
Hey mrpacogp,
Did you try to use the ICL_LANGUAGE_CODE constant instead – you can use it like
if (ICL_LANGUAGE_CODE == 'en') {
//english here
} else {
//other languages
}
Best regards,
Peter
Ok, solved using if(ICL_LANGUAGE_CODE==’en’)
Thanks ^^
Hi,
Great, glad it works now :)
Best regards,
Peter