I have about 100 blog posts and I've been successfully creating 'Page Templates' with ease - and when I create a page I can select the Page Template from the 'Page Attributes' which is all very nice and easy.
I thought the same would be possible for posts...
So I created a post template and saved it as 'single-template-1.php'
Having uploaded the Post Template I notice that there 'Post Attributes' dropdown isn't there so I cant select that template.
Any idea what I could do to fix that?
Thanks!
I have about 100 blog posts and I've been successfully creating 'Page Templates' with ease - and when I create a page I can select the Page Template from the 'Page Attributes' which is all very nice and easy.
I thought the same would be possible for posts...
So I created a post template and saved it as 'single-template-1.php'
Having uploaded the Post Template I notice that there 'Post Attributes' dropdown isn't there so I cant select that template.
Any idea what I could do to fix that?
Thanks!
Share Improve this question asked Nov 23, 2017 at 8:33 HenryHenry 9831 gold badge8 silver badges31 bronze badges2 Answers
Reset to default 6You have to add the following lines at the top of your post template file:
<?php
/*
* Template Name: Featured Article
* Template Post Type: post, page, product
*/
get_header(); ?>
Of course replace "Featured Article" with your desired template name and the list of post types with the post types you want to use the template for.
If it not works, try to delete * before words
like that
<?php
/*
Template Name: Featured Article
Template Post Type: post, page, product
*/
get_header(); ?>