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

Sean May
Sean May
9,145 Points

Theme only displaying one post instead of all of them?

After going through this video and seeing my site shape up into something that is actually starting to look good, I'm running into a problem with The Loop, as it is only displaying my latest post, not all of them as I believe The Loop should be doing.

Here's my index.php:

<?php get_header(); ?>

<section class="row">
      <div class="small-12 columns text-center">
        <div class="leader">

       <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

          <h1><?php the_title(); ?></h1>
          <p><?php the_content(); ?></p>


      <?php endwhile; else : ?>
          <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
      <?php endif; ?>

        </div>
      </div>
    </section>

<?php get_footer(); ?>

I don't think I changed anything from the default loop setup from the WordPress Codex, and looking at the if loop, it should be looking for any posts that are published, but for some reason they're not. Any help?