WordPress.org

Support

Support » Plugins and Hacks » Hacks » Query That Filters Out Multiple Authors?

Query That Filters Out Multiple Authors?

  • I’ve been trying to do a WordPress query and have hit quite a major snag. Here’s the how I want to query the posts:

    <?php query_posts( 's=@' . $user_login . 'author=-4,-5,-6' '&posts_per_page=25' . '&paged='. $paged ); ?>

    As you can see from this code, I’m attempting to exclude authors with the id’s of 4, 5, and 6. However, WordPress does not currently allow this functionality (as it does with categories).

    Does anyone have any ideas how I can accomplish this goal—maybe a custom query/join? Any help would be much, much appreciated!

Viewing 1 replies (of 1 total)
  • Hmm, according to this section the functionality exists. I think the problem is you have no ampersand (&) separating the author argument from the prior search argument. It appears you are asking the query to search for posts with the text “@some_user_loginauthor=-4,-5,-6”!

Viewing 1 replies (of 1 total)
  • The topic ‘Query That Filters Out Multiple Authors?’ is closed to new replies.