If for some reason you don’t want to use a default single post template for your custom post type, you can use a page.php file instead.
On top of this you can also add support for Page Attributes to the code in your functions file which registers your CPT.
The downside of copying your parent themes page.php file to your child theme and renaming it single-cpt.php, is you may lose pagination.
Single CPT Page File
For themes which include get_template_part(), you can simply use this code in your single-cpt.php file rather than all the standard code included in a page.php file.
get_template_part( 'page' );
Pretty cool when you only have one line of code in a template. Just one of the many benefits of using get_template_part() for coding/resource efficiency.
Add Page Attributes To Custom Post Types
This is the line of code you can add to the code you use in your functions file to register your custom post type.
'supports' => array( 'page-attributes' ),
Standard stuff in Genesis but many non Genesis users don’t add this to their code for some reason maybe because they simply don’t know about it.
Add Pagination To Single Custom Post Types
If you need to add pagination to a your single cpt’s, this code may help depending on which theme you’re using.
My opinion is to use a single post file for this as you can easily add page attributes anyway and retain built in pagination.
Was This Tutorial Helpful?