treehouse : what would you like to learn today?
Web Design Web Development iOS Development

No. of Posts to Show (WordPress)

  • Hi,

    I'm having some problem setting up number of posts to show on my blog.

    There is option available to set number of posts to show but as soon as I enter a number & press update it resets back to the default which is 3 & I want to set that to 5.

    Any help in this regard will be highly appreciated.

    Thanks,

    Tahir

  • I am not too sure on this but I'm sure you have to add the query posts function to the wordpress loop on your index.php file.

    Something like;

    <?php query_posts('posts_per_page=5' ); ?>
    

    I have found this link which I think you'll find useful.

    Let us know how you get on @tahirk.

  • Hi, If you want to show only 5 posts (and don't care about pagination), you can use query_posts() like so: query_posts( 'posts_per_page=5' ); If you must use query_posts(), make sure you call wp_reset_query() after you're done. Let me know does it work or not.........