Post Type and a custom Page Template
-
I use the plugin to create 6 new post types. I also use a custom code in my functions.php to register that new type to templates, title and editor. All works fine except for one type.
I created a type, then renamed the slug and did a migration of the few posts that were there. Everything on those posts works fine except that I cannot get the use of a template to that post type. I’ve tried everything I can think of except for creating a new post type and hand migrating post to that new one… To test the function, I added the “supports” tag of post formats (which I do not use) and it shows up on the editor so I know that the function is accurate to the post type name since post format show up but not template.
I suspect that the slug’s ID is messed up somehow but I don’t know where you store the post type id and slug. Maybe that would help.
This is the functions code I use for all my post type to add support. This one is the one that is not working. They are all the same except for the parameters that need to change from post type to post type.
// register custom post type ‘my_custom_post_type’ with ‘supports’ parameter
// Recipe Articles
add_action( ‘init’, ‘recipearticles’ );
function create_my_post_type_100() {
register_post_type( ‘recipearticles’,
array(
‘labels’ => array( ‘name’ => __( ‘Recipe Articles’ ) ),
‘public’ => true,
‘supports’ => array(‘template’,’title’, ‘editor’)
)
);
}Any help would be great. Thanks.
- The topic ‘Post Type and a custom Page Template’ is closed to new replies.