The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

is_page_template() not working? (2 posts)

  1. Drew Baker
    Posted 5 years ago #

    Hey Guys,
    I'm getting some unexpected results with the conditional tag is_page_template().

    I have this in my header:

    <?php if ( is_page_template() ) { ?>
         <!-- Page template being used -->
    <?php } elseif ( is_page() ) { ?>
         <!-- Page template NOT being used -->
    <?php }; ?>

    When viewing a page without a template set, is_page_template() resolves as true for some reason. Does page.php count as a template?

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    page.php counts as a page template.

Topic Closed

This topic has been closed to new replies.

About this Topic