Basic question, but I want to enable page templates. I have one theme which has page templates enabled. I switched to another but there is no option to change the template, even when creating a new page. How do I switch this option on?
I’ve had a root around on the Codex and forum but can’t find it.
Leave a Reply
You must be logged in to post a comment.
Chances are that the theme you’ve switched to has no page templates defined – they exist on a per theme basis.
Here’s the Codex reference: https://wordpress.org/support/article/pages/
Define your template name in the custom template file.
After this the select template option will be available on the edit screen. You can choose the desired name you want.
There is another reason why you may not see the
Page Template
dropdown fiels in your page editor. If you are creating a global page template (one that can be used for any page, you need to ensure that you do not name of your template file with thepage-
prefix, else WP interpret this as a special template for use on page slugs matching the rest of the name.From the page template codex:
and finally make sure you insert the following comment at the top of the page:
/* Template Name: Name-of-your-template */
Allow page template support to you theme by adding this function in your functions.php file: