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 trialJames Carney
16,255 PointsWhich template to use for home.php
Hey Zac. I was watching your video for setting up a blog template, and I know I am supposed to use home.php for the main part of the blog. What I am running into is: In this video "Setting Up the Blog Homepage" though, you use 2 different existing templates to make your home.php. You use single-portfolio.php for the template to save as home.php around the 1 minute mark. Then you immediately say we should save page-sidebar-left.php as home.php at 1:15.
Not sure which one we should go with. I'm assuming page-sidebar-left.php, but I want some clarification on this.
2 Answers
Ernest Guaimano
14,928 PointsUse the page-sidebar-left.php file as a starting point for your home.php file. This is what is used throughout the remainder of this tutorial section.
Bob Sutherton
20,160 PointsI'm not sure if you are trying to build the site exactly as Zac is or not. But if not, all you really need in the home.php template is the header, the footer, and the loop that calls your blog posts. Also, you can add an include for a sidebar if you want to but it would be up to you.
I bet this probably doesn't answer your question if you are trying to duplicate the site Zac is building. If you compare the differences between the
page-sidebar-left.php
and the...
single-portfolio.php
the only major differences you will probably see relate to the sidebar and where is sits in the markup.
Hope this helps or you have probably figured it out by now since this post is a day old.
James Carney
16,255 PointsJames Carney
16,255 PointsYeah... Took a couple times watching the video, but that's what I ended up using for the rest of it and it worked fine.