Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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(); ?>
    <?php
        echo '<h2>';
        the_title();
        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
1  
Please post more context for that code. –  s_ha_dum Dec 22 '12 at 18:22

1 Answer 1

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

 
discard

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.