Support » Plugins » Conditional tags don’t work with WPML?

  • jbucks


    This is a question about WPML. It seems that any conditional tag such as ‘is_home()’ or ‘is_front_page()’ doesn’t work within WPML: I’m trying to output HTML which depends on the page a user is on with conditional tags, such as:

    <?php if (is_front_page()) { ?>
    <?php _e( 'Some text to be translated in multiple languages here ON FRONT PAGE ONLY', 'twentyten' ); ?>
    <?php } else { ?>
    <?php _e( 'Some text FOR INTERIOR PAGES ONLY', 'twentyten' ); ?>
    <?php } ?>

    But basically when I try to view my website which uses the code above with the language switcher, I only am able to see the text in the first language (does not show translated text).

    Any help would be much appreciated, thanks!

  • The topic ‘Conditional tags don’t work with WPML?’ is closed to new replies.