Community Forums › Forums › Archived Forums › Design Tips and Tricks › Custom Page Template Vs Custom Post Template
- This topic has 5 replies, 2 voices, and was last updated 9 years, 5 months ago by
asbilly92.
-
AuthorPosts
-
August 25, 2016 at 9:36 am #192035
asbilly92
ParticipantI made a custom full width page template which works great but is there a way to apply this to a Custom Post Type page?? Would that be a totally different template? I guess I'm noticing that in the Custom Post Type of page I made, there's no option for which template to use...? Is there a similar way to make a custom full width Post type of page layout? Whew that can get confusing.
Using Genesis Minimum Pro theme
Thank you!
August 25, 2016 at 1:06 pm #192042Brad Dalton
ParticipantYou can use the WordPress Template HIerarchy to name it depending on where you want to use it. No template header is needed.
August 26, 2016 at 1:19 am #192059Brad Dalton
ParticipantExample;
single-cpt.php
or
archive-cpt.php
Where cpt is the name of your custom post type.
August 26, 2016 at 10:32 am #192090asbilly92
ParticipantOk I'm not sure I'm understanding. Do you mean make a page and name it either single.cpt for a single PAGE POST template and then for the related archive make one called archive-cpt.php?? Is that what you mean?
Can I use the exact code for the page itself from the full-width one I made for a Page template?? I tried that but upon making the post there was nowhere on the post page to choose the page template I made like a regular page offers.....Not sure how to start a custom POST page template.
If I name it as you say where do you tell that post page to utilize that Post template, or will it automatically use the one named single-cpt.php??
I would like to code the 'middle' part and only pull in the header and footer and make it full with, utilizing existing genesis classes.
I found you post here, will this help me?
Think I might be missing a basic understanding of a page made from a custom page template (that I can make) vs a Post page made from custom post template...?
Thank you!
August 26, 2016 at 10:40 am #192093Brad Dalton
ParticipantThe file will be loaded by WordPress according to the filename. See WordPress Template Hierarchy.
You can use the same template as used for a page however you need to rename the file so it loads on single or archive custom post type pages.
You can test this yourself.
Or
You can see the CPT files in the Executive Pro child theme for single and archive portfolio CPT.
The code you linked to can be used as long as you change the filename.
If you plan on coding yourself, i suggest you setup a test site either on a live server or locally using Desktopserver.
August 26, 2016 at 12:48 pm #192104asbilly92
ParticipantOH I do already have a couple of testing sites 😉 Ok thank you I will give it a shot!
Appreciated!!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.