Support » Themes and Templates » Problem with is_page_template() in index.php

  • I’m using is_page_template() in my index.php file and it’s not working. This is the code I’m using:

    <?php if (!is_page_template('spanish.php')) : ?>Return to Top<?php else : ?>Vuelva a la tapa</a><?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!

Viewing 1 replies (of 1 total)
  • I noticed that looked funny and removed the </a>. It’s still not working though. Now it looks like this:

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

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with is_page_template() in index.php’ is closed to new replies.