WordPress.org

Forums

Query That Filters Out Multiple Authors? (2 posts)

  1. ThomasEMcGee
    Member
    Posted 1 year ago #

    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!

  2. bcworkz
    Member
    Posted 1 year ago #

    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"!

Topic Closed

This topic has been closed to new replies.

About this Topic