Post Type Templates in WP 4.7

(Ben) #1

WordPress 4.7 is including support for post type templates. Basically custom page templates that can work with any post type.

I was wondering if anyone had any thoughts about how this could be used - specifically for blog posts.

I can see the full width template being interesting for blog posts - but is there anything else? Unless it’s specific to a client project I am not sure what else it can be used for. Of course I’m sure this will change as people start working with it - but at the moment I am drawing a blank.

(Adrian Diaconescu) #2

While there are probably some scenarios for actual posts, I’m personally more excited about using this for a portfolio post type and having an easy way to offer the user 2 or 3 layout options.

(Ben) #3

That’s a good point, I think other post types is more interesting for sure.

(Leland Fiegel) #4

I was excited to hear this was coming to 4.7, but have to admit, couldn’t immediately think of any suitable use cases.

Perhaps “art directed articles” would be a worthy use case. There could even be different premade templates for different styles of art directed article. I’m not sure how trendy they are anymore. They seem to have peaked a few years ago, but I still see them sometimes today.

For a “portfolio” post type, I could see different templates being used for different types of portfolio items. For example, a “photography” portfolio item might include a photo gallery, but a “writing” portfolio item might include stylized chunks of text. Or maybe just different layouts of photo galleries.

That’s all I got for now. Might think of some more later.

With all that said, I honestly don’t think I’ve ever even used page templates in a publicly released theme before, so I don’t really see myself using templates for different post types either. It’s nice to know the possibility is there though.

(Jason) #5

I was pretty happy to see that feature as well. My agency only does custom theme development, so it’s a great fit for us. We regularly build page templates for uniquely designed pages, and it will be convenient to be able to extend that natively to other post types. Definitely a welcome addition. :slight_smile:

(Donna McMaster) #6

I would use this. For example, I have a client with a huge database of plants. They fall into two main categories: local native species (good) and invasives (bad), with about 5-10 sub-categories under each.

Natives and invasives share most fields but each has specific attributes and about half the display is different for the two types. Right now I have to look at the plant category’s parent category to determine which sort is which; a ‘plant’ template would be helpful.

(Ben) #7

Hey Leland

I really like art directed posts. However I think some sort of content builder would be a better solution there. Art directed posts don’t seem to happen on blogs any more, but sites like the Verge and Polygon (and other news sites) use them for bigger content. Personally I stopped doing them because it was too much trouble trying to keep things up to date when I changed theme.

Do you mean that none of your themes support page templates or that you haven’t used page templates yourself?


I was thinking that it would be easier to build a blog posts page with for example a full width post followed by 2 half-width posts or even 3 30%-width posts.

I think custom post types benefit most from this though.

(Leland Fiegel) #9

Never made a theme that had custom page templates. I’ve used them for one-off projects though.

(Nate Wright) #10

I’m really excited about this feature. Two use-cases I’ll be exploring soon.

  1. My restaurant menu plugin uses a custom post type. Being able to ship specific template layout options for menus will be great.

  2. Events. Probably something a lot of us work with and there are a lot of different layout treatments you can give an event, with different layouts catering to different priorities.