WordPress.org

Ready to get started?Download WordPress

Forums

2 conditions in a query (3 posts)

  1. Jb5810
    Member
    Posted 7 years ago #

    Hi,

    I want to display in a Page ALL the posts from a particular author (let's say author n°5) AND ALL the posts from a particular category (let's say category n°16).
    I want the posts to be displayed chronologically.

    Can someone tell me if it's possible with a query?

  2. MichaelH
    Member
    Posted 7 years ago #

    i believe the Codex article, Template_Tags/query_posts, has the examples you need.

  3. Jb5810
    Member
    Posted 7 years ago #

    Thanks for your answer.

    But a query like

    <?php query_posts('author=8&cat=3'); ?>

    will only take the posts from category 3 of the author 8. I want all the posts from all the categories of the author 8, and all the posts of the catgory 3.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags