Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialHector F.
27,464 PointsSingle.php is affecting the custom post types layout too...
Is there a way to avoid that?
2 Answers
Garrett Sanderson
12,735 PointsHi Hector, when you have a custom post type and you are using your own page you need to declare its own single.php.
If you throw the custom post type into any page and don't specify its own single page you will automatically default to single.php
For example, say you have a custom post type called portfolio.
If there is no other file that is a single it will default to single.php so you need to set up a new single.
The single for this page would be single-portfolio.php. so single-slug.php is what you want to remember.
Hope this helps
Hector F.
27,464 PointsThank you for your answer!