If you want to experiment with the Custom Post Type & Taxonomy support, you can download our custom post types testing plugin. The plugin registers a ‘td_books’ post type and it adds two taxonomies: ‘td_writers’ and ‘td_genre’.
Theme Panel settings for custom post types and taxonomy
The theme detects all the installed Custom Post Types and it will generate a drop-down with options for each one. Some plugins may register some strange stuff, like post types that are not used on the front end at all. If you see post types that you don’t recognize as your own, we recommend that you leave the default settings for them.
Note: Please note that the WooCommerce products are not included in theme’s custom post types & taxonomy section.
The custom post types & taxonomy settings are located in Theme Panel > CPT & Taxonomy panel area, and they include:
I. Custom post types:
- Breadcrumbs taxonomy – Select the taxonomy that will show up in the breadcrumbs
- Category spot taxonomy – Choose the taxonomy that appears in the category spot and will replace the default “Category” taxonomy
- Tag spot taxonomy – Select the taxonomy that is displayed in the tag spot (after the post content)
- Tag spot text – Replace the default “Tags” label text with the name of your taxonomy
- Custom sidebar + position – choose the post sidebar and its position, and this will be applied globally to all the posts which are part of the CPT for which you are setting this. You can override this option from the post individual settings located in the post editing section.
In the following screenshots, you can see the Custom Post Type single page, and how the settings from the above panel are applied.
II. Custom taxonomies:
- Article display view – Select the module used to display the custom post types on the taxonomy page
- Custom sidebar + position – Choose the sidebar displayed on the taxonomy page and its position
The theme creates a section for each taxonomy, at the same time providing some insights about the taxonomy ID, and the post types that the taxonomy is assigned to. The settings from this drop-down panel will affect the taxonomy archives page.
Note: We have added the taxonomy.php template. If you require custom modifications on taxonomy pages, taxonomy.php should be the starting point for them.
Individual post settings for custom post types
On each post that belongs to a registered post type, you can control the particular sidebar that will be used and its position (left, right or none).
How to create a custom single template for your post type
- Pick one of the available single templates (check the next image)
- Copy it to the root of your theme folder
- Rename it to single-your_post_type.php (replace your_post_type with the WordPress ID of your post type. In our sample plugin, the ID is td_book, so the file should be called single-td_book.php)
How to create a custom taxonomy list
To create a custom taxonomy list, copy the taxonomy.php file from the root of the theme, create another and rename it to taxonomy-YourTaxonomy.php.