Home > OS >  WordPress - How to assign Page Templates to the Custom Post Type
WordPress - How to assign Page Templates to the Custom Post Type

Time:07-30

When creating standard pages we can use single or archive page templates or simply create our own page template creating a new page with the slug for example: photography and actual page: page-photography.php so we can write unique content to each page if we need to.

How can we do the same with custom post types? So, I have a custom post type called services how can I create custom unique pages for each of my services?

I know I can write the content directly to each service page and pull it from there but this is not what I want. I would like to have full control over each service page. Can anyone share the proper solution how to handle this, please?

CodePudding user response:

I think, you can create a file with name single-{post-type}-{slug}.php

see more here, Single Post Template Hierarchy

  • Related