WordPress.org

Forums

The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

How do I avoid posts from the same category in my query? (1 post)

  1. berchman
    Member
    Posted 5 years ago #

    I have a query that works well and looks like this.

    query_posts("showposts=2&tag=featured&orderby=rand");

    However, sometimes the results give me posts from the same category.

    How can I avoid the 2 posts being from the same category?
    I always want them to be from different categories.

    Let me know if you have any questions.
    Thanks,
    Bert

Topic Closed

This topic has been closed to new replies.

About this Topic