WordPress.org

Ready to get started?Download WordPress

Forums

Problem with is_page_template() in index.php (2 posts)

  1. Christiann
    Member
    Posted 5 years ago #

    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: http://omiusajpic.org/espanol/programas/
    (English version: http://omiusajpic.org/)

    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!

  2. Christiann
    Member
    Posted 5 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic