Is there a way to check which template file is being loaded, if it is not a page template file?

I don’t see any way of testing which template file is being loaded, if the template file is not a page template. Otherwise I would use is_page_template().

For instance, I am using a home.php template file to pull in the content from multiple pages(don’t ask), how would I check that home.php is the template file being used when viewing the sites root url?

Related posts

Leave a Reply

4 comments

  1. Just type in some text like “Debug” into the non-Php area of home.php (the part not surrouded by ) and see if it appears. If so, you know that home.php is being used.

  2. If i understand this correctly – I usually echo this somewhere in header.php, to see which template is being used.

    <?php echo get_current_template(true);?>