0

如何找到 wordpress URL 使用的模板

例如,我想更改以下 URL http://portabellointeriors.com/bed-size/super-king/使用的模板

但不确定要编辑哪个文件。

什么是最简单的查找方法

4

3 回答 3

1

使用该功能,body_class()这将作为一个类输出有关页面的大量信息。更多信息:

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

编辑:刚刚检查了该网站,发现该网站body_class()已被使用,它是一个存档页面,因此如果您进行编辑archive.php,那么您将编辑该页面和所有其他存档页面。

于 2013-08-28T20:04:03.977 回答
0

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.

于 2013-08-28T17:58:32.037 回答
0

你也可以使用这个:

global $template;
print_r($template);
于 2013-09-05T09:17:19.623 回答