WordPress.org

Forums

Number of posts on a page (2 posts)

  1. lisa401
    Member
    Posted 11 months ago #

    Hi, I have designed a site where there are going to be a lot of posts on a page (the page being 'tipping') and I need to make it go onto another page if too many posts are on there - is this even possible? Can anyone help with this? Thanks

    Site url: http://www.arbsbetting.co.uk/

  2. vtxyzzy
    Member
    Posted 11 months ago #

    To make pagination work, you must get the current page number and include it in your query_posts(), something like this (untested):

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') :
       ((get_query_var('page')) ? get_query_var('page') : 1 );
    query_posts('category_name=nonfiction&showposts=4&paged=' . $paged);

    Then use a plugin such as WP PageNavi, or the WP functions next_posts_link() and previous_posts_link() to display the links for navigation.

Reply

You must log in to post.

About this Topic