What specific aspect are you looking for here? Just some of the options to appear in that sidebar when editing a post in your custom post types? Something else?
Thread Starter
sevun
(@sevun)
Yes exactly I would like to be able to apply template layout instead of WP by doing this:
Dashboard > Pages > Edit a page > Page Attributes > Template > Change to Default Template
Sounds like https://make.ww.wp.xz.cn/core/2016/11/03/post-type-templates-in-4-7/ is exactly what you’re needing. It’ll require editing the theme files very slightly, but would enable the ability to select one from a dropdown like you can with pages. Do make sure all applicable post types have the “page attributes” option chosen.
Thread Starter
sevun
(@sevun)
Ok thank you a lot for taking care. I will do that. In order to save time it, would be great to have this option. It seems I’m not the only one who is looking for it.
It’s honestly something that’s outside the reach of our plugin to fully enable. We’d rather help in the way we have here, where we point out the settings needed for the post type, and then provide them with something like this link so they can handle the rest. If it was something that could be handled completely by a plugin, we’d consider it, but that’s simply not the case.
Regardless, we hope this gets what you need done π
Thread Starter
sevun
(@sevun)
Thanks but doesn’t work for current WP according to the code editor. π Any suggestions.
What code editor do you refer to? Is this an actual person or perhaps a section of WordPress? Gutenberg plugin maybe?
I’m really hard pressed to believe that they broke this functionality already given that it was only added 2 major versions ago.
Thread Starter
sevun
(@sevun)
Pascal Birchler said:
Please note that “theme_page_templates” is not a file. It is the name of a filter hook. And that code in question is only needed if you’re using WordPress 4.6 or older. If you’re using the latest version of WordPress, that part is completely irrelevant.
As long as you’re on WP 4.7+, which you should be, the only parts you need to worry about are the parts above the “Backwards Compatibility” section.
With that said, you need to edit your custom templates in the theme to tell WordPress that they need to be considered for your custom post types. This isn’t a setting that we have in CPTUI because it’s a theme level edit needing made.
Example from the article:
/*
Template Name: Full-width layout
Template Post Type: post, page, product
*/
It’s the second line that declares what post types the template should be available to.