最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How do I find the directory of a page template?

programmeradmin7浏览0评论

This must be a very amateurish question but...

I'm using page templates from the dropdown menu in page editor but I can't find their source code. I know that usually this can be found in themes/"theme name"/page-templates, but no matter how hard I look, I just can't find the files for several of the templates I'm using ("Full-Width Template", "Page with Navigation Only" etc.). Any tips?

Thanks a lot!

This must be a very amateurish question but...

I'm using page templates from the dropdown menu in page editor but I can't find their source code. I know that usually this can be found in themes/"theme name"/page-templates, but no matter how hard I look, I just can't find the files for several of the templates I'm using ("Full-Width Template", "Page with Navigation Only" etc.). Any tips?

Thanks a lot!

Share Improve this question asked Mar 31, 2020 at 15:39 Kristýna ŠulcováKristýna Šulcová 255 bronze badges 3
  • This really depends on the theme you are using. You could take a look in the functions.php file. – cjbj Commented Mar 31, 2020 at 15:58
  • Ok, but I should be able to find the template name inside functions.php, right? Otherwise it wouldn't show up in the dropdown menu. I did search through my functions.php, but it's not there either... – Kristýna Šulcová Commented Mar 31, 2020 at 17:21
  • Yes, the template name should show up somewhere, but there is not necessarily a file with a template. It may also be generated programmatically. You may even have a plugin that does this. – cjbj Commented Mar 31, 2020 at 19:08
Add a comment  | 

2 Answers 2

Reset to default 1

You can simply right click on your Template Select on the edit page, Inspect Element (on Chrome) then you can check the different options in the select like "page-template.php" as value and find your template file. :)

<select id="inspector-select-control-0" class="components-select-control__input">
    <option value="">Default</option>
    <option value="page-my-account.php">My Account</option>
</select>

It should look like this with your own templates.

I suggest you to download the starter theme from Underscores.me

Once you download it will you get a complete structure of a custom theme with all files available and sample code in it. It is just like a prototype. It helps you a lot and give you best understanding.

发布评论

评论列表(0)

  1. 暂无评论