Assign page template to Custom Post Type

I have created a Custom Post Type in Blocs and I would like to assign to all the posts that will be created for this custom type as default a page template I created.

I did not found any documentation or video on online :frowning:

It’s actually rather simple. Let’s say we’d want to create a page template for “recipes”.

First you’ll duplicate the “single” page template in the blocs sidebar and we’ll call it ‘recipes’.

The second step is to set you WordPress loop to just get the posts of your custom post type. This can be done in the right hand column of Blocs:
Schermafbeelding 2021-06-06 om 20.00.33
In this case you’ll replace the type “Post” with your custom post type.

Within WordPress you can then select the “recipes” template as page template when creating a new page to represent your custom post type.

Good luck!

1 Like

Wow that is easy!

Thanks for the hint :slight_smile: