Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1011199

    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/ ?

    • This topic was modified 6 years, 2 months ago by mrpacogp.
    #1011205

    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

    #1011207

    Ok, solved using if(ICL_LANGUAGE_CODE==’en’)
    Thanks ^^

    #1011209

    Hi,

    Great, glad it works now :)

    Best regards,
    Peter

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.