2 Added notes about admin bar issues
source | link

Use this line, late in footer.php:

echo '<ul><li>'.implode('</li><li>', str_replace(get_home_pathstr_replace('\\', '/', ABSPATH).'wp-content/', '', array_slice(str_replace('\\', '/', get_included_files()), (array_search(get_home_pathstr_replace('\\', '/', ABSPATH).'wp-includes/template-loader.php', str_replace('\\', '/', get_included_files())) + 1)))).'</li></ul>';

Written at:

How do you find out which template page is serving the current page?

if admin-bar stuff path is showing at the top, or any other file, change the filename template-loader.php in this line of code to: whatever filname you need to break from.

if you need this in the admin bar, use the right priotity (earliest) to make shure no files are entered at the end of this list. For example:

add_action('admin_bar_menu', 'my_adminbar_template_monitor', -5);

priority -5 make shure it loads first. The key is to render this line at the right moment.

Do some changes if your server using dubble-slashes.

More at: How do you find out which template page is serving the current page?

Use this line, late in footer.php:

echo '<ul><li>'.implode('</li><li>', str_replace(get_home_path().'wp-content/', '', array_slice(str_replace('\\', '/', get_included_files()), (array_search(get_home_path().'wp-includes/template-loader.php', str_replace('\\', '/', get_included_files())) + 1)))).'</li></ul>';

More at: How do you find out which template page is serving the current page?

Use this line, late in footer.php:

echo '<ul><li>'.implode('</li><li>', str_replace(str_replace('\\', '/', ABSPATH).'wp-content/', '', array_slice(str_replace('\\', '/', get_included_files()), (array_search(str_replace('\\', '/', ABSPATH).'wp-includes/template-loader.php', str_replace('\\', '/', get_included_files())) + 1)))).'</li></ul>';

Written at:

How do you find out which template page is serving the current page?

if admin-bar stuff path is showing at the top, or any other file, change the filename template-loader.php in this line of code to: whatever filname you need to break from.

if you need this in the admin bar, use the right priotity (earliest) to make shure no files are entered at the end of this list. For example:

add_action('admin_bar_menu', 'my_adminbar_template_monitor', -5);

priority -5 make shure it loads first. The key is to render this line at the right moment.

Do some changes if your server using dubble-slashes.

More at: How do you find out which template page is serving the current page?

1
source | link

Use this line, late in footer.php:

echo '<ul><li>'.implode('</li><li>', str_replace(get_home_path().'wp-content/', '', array_slice(str_replace('\\', '/', get_included_files()), (array_search(get_home_path().'wp-includes/template-loader.php', str_replace('\\', '/', get_included_files())) + 1)))).'</li></ul>';

More at: How do you find out which template page is serving the current page?