This website uses cookies to allow us to see how the site is used. If you continue to use this site, we assume that you are okay with this. If you want to use the sites without cookies, please see our privacy policy.

Print out the filename of the current WordPress template

This is quick snippet thats useful for when your coding and want to know which template is being used for the page you’re viewing in the browser.

No need to tax your brain about the WordPress Template Hierarchy.

add_action('wp_head', 'show_template');
function show_template() {
	global $template;
	print_r($template);
}

About

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.