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 trial

WordPress WordPress Theme Development Custom Post Type Templates in WordPress Coding Your Own Custom Post Type Templates

Suzie Israel
Suzie Israel
4,242 Points

When I go to my new custom post type and create a new post, the "Templates" dropdown is missing from under Attributes.

I used the "Custom Post Type UI" and "Advanced Custom Fields" plugins to create a new custom post type as described in this video. Using page.php as a base, I saved it to a new file called "portfolio_page.php", and put this at the top of the code:

<?php /* Template Name: Portfolio_Page */ ?>

The Templates dropdown does not appear when I view a post in my new custom post type. The Portfolio_Page template appears in the Templates dropdown if I am viewing a page from the Pages section, however, so I don't think it's a problem with the custom template.

Any ideas would be greatly appreciated!

p.s. It also might be worth mentioning: ā€¢ I tried to "reset" the page template functionality by switching themes, going to a page and viewing different templates, then switching back to my original theme. I also tried deactivating all extraneous plugins (I have used the local MAMP installation for practicing other things besides this course.) ā€¢ Shortly after this issue occurred, my site went down and produced a 500 error. I reinstalled Wordpress and added in the Treehouse theme folder and related plugins one at a time. The site is working again but the original issue still persists.

2 Answers

Simon Duchaine
Simon Duchaine
14,441 Points

I'm not sure if I understand your problem well, but it's normal that you don't see the "template dropdown" in a post edition, as you created a custom page template.

If you wanted to have a custom design for a single portfolio post, you need a custom post template (and not a custom page template).

Suzie Israel
Suzie Israel
4,242 Points

Thanks for the quick reply...I was confused when I posted this and realized it shortly after posting, but did not know how to remove the question. The real issue is I want to be able to create a template for a single custom post type, and as it turns out I just needed to wait a couple more videos for Zac to cover that.

Sorry for the confusion and thanks again!