This is a rather small change, mostly UI-wise, because most of it is already there, but would help a lot: Using Page Templates for any kind of Post Type, eg. posts or Custom Post Types
A direct use case: Custom Post Type for client site, eg. “Project” or “Referenz”, which is mostly similar as a “normal” page.
Another one straight from a current client project: WooCommerce Product pages - the client got a custom built “Page Template” UI, which essentially fullfils the same role as described. That could have been entirely skipped over with an actual standard, built-in option.
yes, you ARE missing something. You obviously did NOT read the links already mentioned in this thread. Ie. I am NOT talking about using a singular template.
I think I have an idea.
It’s not the standard post template that is needed (single.php with sidebar, without etc).
It’s a default template just for custom post types.
Something that the user can the modify.
At present when registering a CPT you need to also prepare a template for that because core doesn’t handle that.
Basically you end up duplicating a template and tweaking it to your likings and then you need to link it to the CPT.
While it’s easy the registering CPT part (just use a generator that gives you the code if you are not a dev), many people aren’t comfortable coding a template from scratch or modifying one, and there’s no easy way around that (plugins doing templates for CPTs need you to understand what you are doing).
This petition (if it is what I am understanding) will lessen the need for templates builders like the beaver builder add on for CPTs and ease the struggles of people who want a CPT template but aren’t able to do it on their own.
The requirement is clear from the Ticket that @fwolf linked:
I would like to add a template and have it available to all Post Types.
Perhaps add like this:
/*
Template Name: Full-width layout
Template Post Type: any
*/
So when you want one template for all post types available, instead of doing this: Template Post Type: post, page, artist, album, track, and-any-other-cpt-you-may-have
you would do this: Template Post Type: all
or Template Post Type: any
So instead of creating one template with all CPT names in the Template Post Type header, or many templates with each a CPT in the Template Post Type header, you would have one template with any as value.
I see one issue with this.
There might be actually a CPT named any or even all and making the header possible to hold that value would mean to make that or those words reservedwhich they are not as of now
So the value used would have to be something that is most likely not already used in some CPT name (because otherwise, the template would apply only to that single CPT and not to all)
Possible values thus could be cp_all_post_types_temlates or whatever complex, probably unique value.
But I am not sure that is such a good idea.
Do you really want your template you may very well use for 100 of your custom post types also on page, posts, and the custom post type the client or user created on his own?
Templates are specific, always, no matter for how many Post Types they are valid, they are and will not be valid for an eventual third post type just because of a single Custom Field, or perhaps no Featured image but your template includes it, and so on.