WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to use multiple variables in query_posts? (2 posts)

  1. ProtusMose
    Member
    Posted 1 year ago #

    I've created two author's whose posts I only want ot show on specific pages, so I'm excluding them from other places. When I only had one author needing this, it worked fine with:

    query_posts('posts_per_page=5&orderby=date&order=DESC&author=-20');

    I can't find the right syntax to add the other, though. I've tried:

    query_posts('posts_per_page=5&orderby=date&order=DESC&author=-20,-18');
    query_posts('posts_per_page=5&orderby=date&order=DESC&author=-20,18');
    query_posts('posts_per_page=5&orderby=date&order=DESC&author=-20,&author=-18');

    None seem to accomplish it. How can I get it to ignore two different author IDs?

  2. ProtusMose
    Member
    Posted 1 year ago #

    bah. didn't see I had added the comma. removing it resolved.

Topic Closed

This topic has been closed to new replies.

About this Topic