Hello @representativeself,
You can create templates for custom post types (CPTs) directly within the Site Editor by navigating to Appearance > Editor. In the left Navigation Sidebar, select Templates. To make your custom post type appear in this list and create custom templates for it, ensure it’s registered with 'show_in_rest' => true
. This setting allows the CPT and its fields to be accessible in the Block Editor.Steps to Create a Template for a Custom Post Type:
- Add a New Template:
- Click on the plus icon (+) to add a new template. You’ll see a scrollable modal window with available template types.
- If a specific template already exists, it won’t appear in the list. In this case, you can edit or delete the existing template instead.
- Choose from Template Options:
- You can create templates for different purposes, including:
- A default template for all items of the post type.
- A single item template for individual posts of that type.
- An archive template for listing all items of the custom post type.
- A taxonomy archive template for displaying items under specific taxonomies.