fbpx

« Tillbaka till bloggen

Snippets | 8 mar 2020

Print out the filename of the current WordPress template

When you are coding you want to know which template is used. This way is really easy to edit the right file. No need to tax your brain about the WordPress Template Hierarchy.

Here are two examples to do it:

1. Either print out the file that is used in the WP-adminbar:

Print out the filename of the current WordPress template - show in WP-adminbar
Print out the filename of the current WordPress template – show in WP-adminbar

2. Or just print the file name on the page directly:

Print out the filename of the current WordPress template - print directly on the page.
Print out the filename of the current WordPress template – print directly on the page.