WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to display the posts on my front page of the roots theme's base.php file.

I have added the loop as

<?php while (have_posts()) : the_post(); ?>
        echo '<h2>';
        echo '</h2>';
        the_content( 'Read the full post »' ); ?>
<?php endwhile;?>

However, this keeps displaying just the content and title from the first page.

How do i get it to display the posts? I have set the number of posts as 3 under settings -> reading .

share|improve this question
Please post more context for that code. – s_ha_dum Dec 22 '12 at 18:22
up vote 3 down vote accepted

Just save it with a suitable name like:

  • home.php
  • index.php
  • archive.php
  • category.php

This link can help you: WordPress Template Hierarchy

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.