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

Paul Neumyer
Paul Neumyer
15,301 Points

Missing Post's per Page in Front-Page.php

It's not a big deal but after reviewing the video, if you are not careful you would still end up with 4 boxes with post type "work" on the front-page.php.

Between 11:10 and 11:25, Zac Gordon forgets to mention that you still need to add 'posts_per_page' => 1 to the $args array in order to display 1 post on the front page and not 4. Like I said it't not a big deal but if you just followed what he said and was not paying attention you would still end up with different results.

                    <?php 

                    $args = array(
                    'post_type' => 'work',
                    'posts_per_page' => 1
                    );

                    $the_query = new WP_Query( $args );

                    ?>

2 Answers

Paul Neumyer
Paul Neumyer
15,301 Points

No, thank you and the Treehouse Teachers for all you do.