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 The Portfolio Homepage

In edit page, there is no Portfolio Page template available

I'm doing the same as in videos and all is going good, but In edit page, there is no Portfolio Page template available to select from drop down list, as Zac did in video at time 1:25. The options available there are only "Default Template" and "Left Sidebar". Plzzz Help meeee!!!!

1 Answer

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Hi Mic,

Make sure you're working with page.php in your Wordpress install.

Each different template needs to have a special comment at the top of it called which has the Template name.

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

So this is how WordPress picks up that there are alternative templates to pick from.

Check that you have one of these comments in your template file.

If not, save page.php as a different name and add this comment or check that in those comments

Default Template is written in there instead of the template name you want.

Good luck. :-)

I didn't declared <?php /* Template Name: Blog Template: */ ?> in page.php. Should I?

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,253 Points

It's best to leave page.php as your default blog page.

So in your text editor save a copy this as something like page-blog.php with that comment inside and see what comes up in your admin area.

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