WordPress.org

Support

Support » Themes and Templates » is_page_template() not working?

is_page_template() not working?

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

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘is_page_template() not working?’ is closed to new replies.