1

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!

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... 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

2 Answers 2

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.

1
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.