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

Displaying latest 3 blog posts on front-page.php

Hello,

I am working on a website with WordPress and I am wanting to display the latest 3 blog posts on the front-page.php page. Right now The Loop on the front-page.php is only displaying the title of the page. How would I do this?

1 Answer

The loop can be different on every theme. But try this:

Before this: <?php if (have_posts()) : ?>

Add This <?php query_posts('showposts=3'); ?>