Number of posts on a page (2 posts)

  1. lisa401
    Posted 2 years 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
    Posted 2 years ago #

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

    $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.

Topic Closed

This topic has been closed to new replies.

About this Topic