WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Page navigation & query_posts (6 posts)

  1. loauc
    Member
    Posted 5 years ago #

    Hi,

    I'm using query_posts('cat=-7') to exclude posts from category 7 in my index page. Then, I'm using posts_nav_link for page navigation. The problem here is that I only get the most recent posts displayed.

    I have tried setting the Options > Reading > max number of posts per page to 3, to -1, to 10 and also specifying them in the query_posts('cat=-7&posts_per_page=3') function but I don't get the expected behaviour.

    Any suggestions?

    Thanks in advance,
    Felix.

  2. loauc
    Member
    Posted 5 years ago #

    Solved!

    In order to preserve the navigation I had to use:

    query_posts($query_string . '&cat=-7&posts_per_page=3')

    Is not nice to skim through the documentation :)

    --Felix

  3. oldnumber9
    Member
    Posted 5 years ago #

    That works great! You just solved 60 min of frustration.

  4. loauc
    Member
    Posted 5 years ago #

    Glad to be useful.

  5. termserv
    Member
    Posted 4 years ago #

    Does this only affect the index page? It won't work if I use a custom page template with query_posts() :(

  6. termserv
    Member
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic