Languages: English • 日本語 (Add your language)
Retrieve path of page template in current or parent template.
First attempt is to look for the file in the '_wp_page_template' page meta data. The second attempt, if the first has a file and is not empty, is to look for 'page.php'.
<?php get_page_template(); ?>
None.
Displays the filename of the page template used to render a Page (printed within an HTML comment, in this example) :
<?php echo '<!-- ' . basename( get_page_template() ) . ' -->'; ?>
Since: 1.5.0
get_page_template() is located in wp-includes/template.php
.