Support » Fixing WordPress » How do I avoid posts from the same category in my query?

  • 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

  • The topic ‘How do I avoid posts from the same category in my query?’ is closed to new replies.