admin管理员组

文章数量:1410674

I would like to apply layout templates to my posts, just like I can do with pages. For example, I have a template-wide.php that does not include sidebars and adds a special "wide" class to the content div.

At present, I can only use this template for pages. Is it possible to make it available to posts as well?

I would like to apply layout templates to my posts, just like I can do with pages. For example, I have a template-wide.php that does not include sidebars and adds a special "wide" class to the content div.

At present, I can only use this template for pages. Is it possible to make it available to posts as well?

Share Improve this question asked Mar 4, 2011 at 21:06 Scott BScott B 5,69614 gold badges94 silver badges148 bronze badges 1
  • A more up to date overview can be found here: Can I assign a template to a custom post type?. – Nicolai Grossherr Commented Sep 14, 2018 at 9:52
Add a comment  | 

2 Answers 2

Reset to default 2

Use the Custom Post Template Plugin.

WordPress 3.1 includes a new feature called Post Formats. It's a little like how Tumblr lets you have different formats for different kinds of content, and I think it could be adapted to what you are trying to do. I haven't actually used it yet, but here's an introduction I found that might be helpful.

本文标签: theme developmentPossible to add quotTemplatequot selector to posts