Forums

query_posts exclude not working with paging (3 posts)

  1. arnie2
    Member
    Posted 2 years ago #

    Hi,

    i want to display posts only from 4 of 5 categories. The query_posts('cat=-24') is working correctly untill I want to show all the posts on one page. When i set to display only 3 posts per page (reading settings), on the next page are displayed the same posts as on the first one and the whole thing is not working on other than the first page :/

    Is it required to make an extra setting ?

    the query_posts statement is inserted in index.php before the loop
    while ( have_posts() ) : the_post()

    Thanks a lot guys ..

  2. MichaelH
    Volunteer
    Posted 2 years ago #

    This should help:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('cat=-24&paged='.$paged);

    You might also find this plugin useful:
    http://wordpress.org/extend/plugins/custom-post-limits/

  3. webchilly
    Member
    Posted 1 year ago #

    Thanks MichaelH, Was of Great help.

    [sig moderated]

Topic Closed

This topic has been closed to new replies.

About this Topic