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 new to WordPress and not that familiar with coding. Could someone explain how to add a loop to my blog to the static front page? I'd like for the first 10 blog posts to be displayed under my content on the home page. Please keep in mind I am not that familiar with coding so step by step instructions would be very helpful. I found this code

query_posts( 'showposts=10' );
<?php 
if ( have_posts() ) : 
    while ( have_posts() ) : 
        the_post();

    // do something

    endwhile;
else :

    // no posts found

endif; 
?>

but I am unsure how to use it. What do I need to delete, insert, where does it need to be inserted in the code, etc. Sorry for being such a beginner, but any help would be greatly appreciated.

share|improve this question
    
You need to output a secondary query, using new WP_Query(). Please refer to this question/answer explaining why not to use query_posts(), and how to use WP_Query(). –  Chip Bennett Aug 30 '13 at 16:24
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.