Adam Scot
Adam Scot

Reputation: 1409

How do I find out which template a wordpress URL uses

How do I find our which template a wordpress URL uses

E.g. I would like to change the template used by the following URL http://portabellointeriors.com/bed-size/super-king/

but am unsure which file to edit.

What is the easiet way to find out

Upvotes: 0

Views: 125

Answers (3)

StevePeev
StevePeev

Reputation: 659

You can also use this:

global $template;
print_r($template);

Upvotes: 0

user2019515
user2019515

Reputation: 4503

Use the function body_class() this will output a lot of info about the page as a class. More info:

http://codex.wordpress.org/Function_Reference/body_class

Edit: Just checked the website and saw that body_class() was already being used, it is an archive page so if you edit archive.php then you'll edit that page and all other archive pages.

Upvotes: 1

Ennui
Ennui

Reputation: 10190

Refer to the Template Hierarchy article in the WordPress Codex. If you read and digest that whole article you will be able to figure it out.

You can also log into the back-end and edit that specific page and see if a template is defined in the box on the right, but likely it is a custom post type archive template so that probably won't get you anywhere.

It depends a lot on how the site is set up, but you are probably looking for a template file starting with archive or category or taxonomy as that is definitely an archive page of some kind. If you can provide further insight into how the content is organized (custom post types, custom taxonomies, tags, categories, and so forth) I can help further.

Upvotes: 0

Related Questions