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

templates - My 'post attributes' is missing from my WordPress install

programmeradmin3浏览0评论

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 badges
Add a comment  | 

2 Answers 2

Reset to default 6

You 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();  ?>
发布评论

评论列表(0)

  1. 暂无评论