Learn how to remove page templates in any Genesis Framework child theme by code thanks to this tutorial.
Genesis Framework offers 4 page templates that can be found in the “Template” drop-down in the “Page Attributes” metabox:
- Default template
- Blog
- Archive
- Landing
In most cases you don’t need them all. In fact, it’s a good idea to remove the ones your client won’t need to make their life easier and avoid confusion.
You know, less is more. 😉
Are you interested? It’s as simple as this:
Snippet to delete page templates in Genesis
Add this fragment to the end of the functions.php file:
To see this and another 997 code snippets of this website, login or subscribe here.
When you use this code, the Blog and Archive templates will no longer be displayed in the “Template” drop-down in the “Page Attributes” metabox.
Do you want to hide the “Landing” template too? Enter the next line in the previous block:
To see this and another 997 code snippets of this website, login or subscribe here.
Or if you prefer you can delete the line of the template you want to keep. It’s up to you.
Conclusions
Now you know how to remove the page templates in a Genesis child theme with a simple snippet.
Any questions? I read you in the comments.
And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉