Meks
Do you know you can try any of our premium WordPress themes for free?Show me the themes
Quickly find which WordPress template file is currently being used

Quickly find which WordPress template file is currently being used

11Shares

If you ever played with WordPress theme files and tried to modify it by yourself, you probably already heard and learnt about the WordPress template hierarchy.

However, sometimes it’s hard to predict what template file is being used and loaded on the current page by just looking at the WordPress website frontend and the current page url. This can become even trickier if you are wrangling with a custom theme, made by someone else. Or, there might be specific plugins which hijack and override theme default template files. Yikes!

Show what template file is being used in WordPress

Luckily, there is a quick and easy way to find out the template being used. You can just add this little code snippet in your theme functions.php file:

That’s it! Make sure you are logged in, look at the very bottom of your website and you will see the path to the WordPress template file being loaded on the current page. Below is an example how it looks like on our own Meks website.

Top Hosting recommended by Meks

Detect which WordPress template file is currently being loaded (plugin solution)

While we personally prefer the above solution,  as it is probably easier to just comment/uncomment this piece of code whenever you need it, there are a couple of plugins which may help you to achieve the similar thing.

Fell free to install and experiment with one of these plugins:

  1. Show Current Template
  2. Reveal Template
  3. Which Template Am I

11Shares
Bojan Petrovic

Co-founder and WordPress developer at Meks. He has been involved in the business since 2009. creating themes, plugins and services on top of WordPress, continuously aiming to choose best approaches and work smarter, not harder.

Try theme now for free!
  • Access to a copy of the demo website
  • Full access to the theme options
  • No credit card required

* We will send you an occasional newsletter with special offers, news & theme updates but you can unsubscribe at any time.

Meks