Support » Fixing WordPress » is_page_template() isn’t working in index.php?

  • I’m using is_page_template() in my index.php file. It doesn’t work — is there some other way I should be doing this? This is the code I’m using:

    <?php if (!is_page_template('spanish.php')) : ?>Return to Top<?php else : ?>Vuelva a la tapa<?php endif; ?>

    It’s on this page:
    (English version:

    This works fine on my sidebar.php, header.php, etc. I’m wondering if it doesn’t work in index.php for some reason? Any thoughts?

    Thanks everyone!

    (I hope this is OK to post here — I got no response the the “themes” forum, and haven’t come up with a solution on my own yet, so I’m trying this section.)

  • The topic ‘is_page_template() isn’t working in index.php?’ is closed to new replies.