I have created a custom post type with capability => 'page'. Why can I not or how do I add the Page Attributes/Page Templates meta box to the admin edit page?
Yeah, cheers Joe. I also found this out about 20 mins after posting the original question. So, as long as you have page_attributes on you simply allow your templates to be accessible by adding: Template Post Type: new_post_type_name under Template Name: your_template_name in your custom template!
I have created a custom post type with capability => 'page'. Why can I not or how do I add the Page Attributes/Page Templates meta box to the admin edit page?
Yeah, cheers Joe. I also found this out about 20 mins after posting the original question. So, as long as you have page_attributes on you simply allow your templates to be accessible by adding: Template Post Type: new_post_type_name under Template Name: your_template_name in your custom template!
Share Improve this question edited Apr 29, 2017 at 13:59 Harry Black asked Apr 26, 2017 at 19:50 Harry BlackHarry Black 111 silver badge3 bronze badges 1 |2 Answers
Reset to default 1Check out my answer to a similar post. Custom page type - template under page attributes?
You'll have to create a page template and make that available to your new custom post type.
You can't apply templates to custom post types. However if you want to style all your single custom post types in the same manner but different from other post types you could use the single-[posttype].php -> Template_Hierarchy
The reason this hasn't been implemented is because custom posts can be styled using the default wordpress hierarchy.
For example, if you create a post type called custom-post you can create a template called single-custom-post.php that only applies to those custom posts and archive-custom-post.php that applies to the archive page. You can even add page-{post-id}.php to create a template for one specific page.
register_post_type()
call look like? Add that code to your question. There is an array of options for thesupports
argument. – jdm2112 Commented Apr 26, 2017 at 19:59