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

PHP How to Build a WordPress Theme Extending WordPress Template Functionality Adding Content in Custom Places: Part 2

Ari Winokur
PLUS
Ari Winokur
Courses Plus Student 6,844 Points

Amazing how code just appears between views!

Somehow from one view of front-page.php to the next time, the line 'posts_per_page' => 1 is added to the Recent Post arg array! Somebody forgot to explain a step?

2 Answers

Aaron Hultquist
Aaron Hultquist
17,821 Points

I believe Ari is referencing the recent project portion of the home page, beginning at 9:05.

Zac has us copy code from work.php, which does not include posts_per_page. Multiple projects are displayed when he shows the homepage after adding the extra grid_6 div. After he clears out the grid_6 div, the homepage only shows one project.

After backing up the video several times, I noticed the posts_per_page => 1 code is in place when he goes back to front-page.php to delete the extra div.

I guess you could say this is a troubleshooting exercise that we should be able to figure out on our own this far into the course, but a step is most definitely skipped in the video.

Andrew McCormick
Andrew McCormick
17,730 Points

at around 2:19 mark he goes over that he copied and pasted the same arguments from the content-testimonials.php file . When he pastes those arguments in there, posts_per_page' => 1 is already included.