• Hello,

    I have a multilingual site I’m working on in WPML. I want to prevent some widgets from appearing on the Spanish version of the site. I am using WidgetLogic to do this and I am able to specify the pages to exclude. However, I can’t figure out the conditional statement to exclude the home page for the Spanish site.

    I have the Spanish site set up as http://www.example.com/?lang=es

    The conditional tag I’m using for the other pages is:
    !is_page(array(229,249,254,256,259,262,265,281,292))

    I can’t use !is_home() because that will exclude the English home page.

    Any help would be greatly appreciated!

Viewing 8 replies - 1 through 8 (of 8 total)
  • try

    $_GET[‘lang’]==’es’

    Thread Starter antorera

    (@antorera)

    I was looking for something like this. Now how do I use it to exclude the spanish version being used? Or is the “$_” part what excludes it?

    to make a widget appear when the URL has ?lang=esm use the above, to make a widget vanish when that’s the case use

    $_GET[‘lang’]!=’es’

    I was just looking for this… thanks!

    This one is mybe better

    ( ICL_LANGUAGE_CODE == ‘en’ )

    Dealing with the same issue and tried the above suggestions. Not sure if I’ve used the correct syntax as neither of the following does anything. Ideas?

    is_home($_GET['lang']!='es')
    is_front_page($_GET['lang']!='es')

    In Settings > Reading The front page is set to the latest posts.
    Using WPML for translation.

    try

    is_home() && (ICL_LANGUAGE_CODE == ‘en’ )

    for the home page in english

    Thank you for that, Alan.

    What I ended up with was this for the English side:

    is_home() | is_page() && (ICL_LANGUAGE_CODE == 'en' )

    And this for the Spanish side:

    is_home() | is_page() && (ICL_LANGUAGE_CODE == 'es' )

    John

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘how to find home page id for different language page’ is closed to new replies.