Custom Post Types and CBOX Theme
- This topic has 2 replies, 2 voices, and was last updated 9 years ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Hi, sort of a follow up on my previous question, I just want to make sure I’m on the right track. I’m adding a custom post type (using wp-types/toolbox) for resources to our CBOX site with several custom fields and custom taxonomy (categories and tags).
Typically I would add (at a minimum) the following templates (possibly sub-divided into template parts) to display content from this CPT (assuming CPT slug is: resources): single-resources.php, archive-resources.php, taxonomy-resources_category.php, taxonomy-resources_tag.php.
While it is a little different for each of the templates at the core is creating a new WP_Query object with a post_type argument for the CPT and then running the loop with render statements (types_render_field for the CPT plugin I’m using) for each of the custom fields.
So, the question is, will this be a workable approach with the CBOX theme as it has been for other themes, or does the infinity engine provide for Custom Post Types in the option/configuration files?
Kind regards,
Troy
Hi @troy in my experience, the CBOX theme behaves no differently to other WordPress themes when it comes to CPTs – if you want full control over their appearance, then you’ll need to add the template files that you mention. I would, of course, recommend that you work with a child theme so that you leave the parent theme untouched.
Thanks Christian. I spin up a child theme as part of my installation routine, always good advice.
Tory