can I assign a template file to custom post types?
I have created a custom post type called
items, and I would like to assign templates to the items like you can do with pages.
You can create template for custom post types by creating files, like for example :
See Template Hierarchy in the codex.
PS : this has already been answered.
Yes you can do it, it is a little complex to write here so my anser will be links.
http://www.wpbeginner.com/wp-themes/create-custom-single-post-templates-for-specific-posts-or-sections-in-wordpress/ ( this is for posts but you can modify it for CPT's)
http://www.nathanrice.net/blog/wordpress-single-post-templates/ ( this is for posts but you can modify it for CPT's)
It's a good idea for a plugin actually.
Here's what works for me:
Thus given a post of custom post type