Where's the Template For Custom Post Type Posts?

Posted in: Newspaper
Post count: 62

Upon creating a custom post type, using “register_post_type” function, I am having trouble finding the template that is used in displaying these custom post type posts. I can see that regular posts use “single_template_x.php” files for their templates and can be selected in dashboard during the creation of a post, however, I don’t see the option to choose a template when creating a custom post type post. Do all custom post types use a specific, pre-defined template and where is this file located?

Post count: 22421

Hello,
Custom post types use the default template as the global option. There is no option to change it however as the post styles were only created for posts only. You can edit the single.php and loop-single.php files if you want but this will also affect posts that use the default template.
Thank you!

Post count: 62

Would this solution that I found on you site work? I got this from – https://forum.tagdiv.com/custom-post-type-support/

How to create a custom single template for your post type

pick one of your favorite single templates [see image]
copy it in the root of your child theme folder
rename it to single-your_post_type.php (replace your_post_type with the wordpress id of your post type. In our sample plugin the id is td_book so the file should be called single-td_book.php)

Post count: 22421

Hi,
Yes, that should work as the guide instructs.
Thank you!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.