Archived topic
How To Create Single Post Template Element for Custom Post Type
5 replies · Started by Brent Wilson on February 10, 2022
How do I create various single post and archive templates for custom post types? Is it possible to do this simply using block elements and pulling in dynamic content through GB blocks? The custom post types and custom fields would be created with MetaBox.
Additionally, can I create archives for various custom posts that only show posts with certain taxonomies?
Hi Brent,
If you have a Custom Post Type, and you wish to modify its archive content template, it should be possible.
The specific Custom Post Type Archive should be a choice available in the Display rules location.
See this as reference: https://share.getcloudapp.com/2Nuvogw2
Also see: https://share.getcloudapp.com/rRuNA8kb
The same goes for single post templates. You should also be able to select it in the display rules: https://share.getcloudapp.com/7KuqN7qo
As for having a Content template applied only to a specific category of a Custom Post type archive, this is also doable.
See this for reference: https://share.getcloudapp.com/KouY8vJ9
Here is a video you may refer to for more information with regards to Content templates: https://www.youtube.com/watch?v=-ZTQP_KA2xE
Here is the link to our YouTube channel for more informational videos: https://www.youtube.com/c/GeneratePress
Hope this answers your inquiries. :)
I feel like I am missing something in this. When I go to a single custom post URL (https://wordpress-483838-2431328.cloudwaysapps.com/presenters/brent-wilson/), I am getting an error page. Do I need to be doing something additional in order for a custom post type page to show up using an element template?
I am getting an error page
Check if your permalink is set correctly.
This error should not be related the content template, can you try disable the block element - content template to test?
I resaved the permalink setting, and now the single custom post is showing.
That's good :)