OllieWP / ollie

A finely-crafted WordPress block theme by Mike McAlister
https://olliewp.com
GNU General Public License v3.0
334 stars 44 forks source link

Setting Ollie templates for custom post types in Ollie Theme #119

Closed jaseppan closed 3 months ago

jaseppan commented 5 months ago

Is it possible to set a template created in the Ollie theme editor as the default template for either the archive page or single post view of a custom post type?

mikemcalister commented 5 months ago

Hi there,

If you have the custom post type available on your site, you should be able to create a template for it via the Site Editor interface. Check out this link for info about how to do that.

Once you create the custom post type archive and single page, the theme will use that to display the specific view.

jaseppan commented 5 months ago

Thank you, Mike, for your response. Originally, I attempted to use the Site Editor to create templates for my custom post type, but I noticed that the templates were not being listed. After some investigation, I discovered that the issue was related to the REST API support for the custom post type. By setting 'show_in_rest' => true, I was able to successfully integrate the post type with the Site Editor.