Assuming “users” you are trying to pull is a custom post type. You can use “tax_query” as below.
$user_args = array(
'post_type' => 'custom_user_post', // Custom post type,
'posts_per_page' => 10,
'paged' => ( ! empty( get_query_var( 'paged' ) )? get_query_var('paged'): 1 ),
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'user_sports', //assuming your custom taxonomy is 'user_sport'
'field' => 'slug',
'terms' => array( 'football' )
),
array(
'taxonomy' => 'user_sports', //assuming your custom taxonomy is 'user_sport'
'field' => 'slug',
'terms' => array( 'basketball' )
)
)
);
$users_list = new WP_Query( $user_args );
Related Posts:
- How to create a WP_Query to search the Title or Tag?
- Display certain amount of posts on taxonomy archive page
- How do I get taxonomy terms by ID in a specific order
- Get taxonomy terms only of the WP_Query current posts
- WP Query with custom Shortcode
- Customising the search function?
- WordPress default Search function inconsistent in WooCommerce Product Titles
- Get term siblings of current child taxonomy
- How to get post’s current parent term ID?
- register_taxonomy() take much queries
- List taxonomy term slugs within shortcode (do_shortcode)
- Copy taxonomy terms from one post to another programmatically
- Hide image if taxonomy term is empty
- Isotope Drop Down Categories Filter Function
- How to filter custom taxonomy term name, slug, and description?
- Hierarchical taxonomy list with modificated term links
- Exclude product attributes from taxonomy terms loop
- Trying to display terms from custom taxonomy within function
- WordPress Conditional / Multiple Taxonomy Query
- How can I modify this code to make the search box include tags and meta
- How do I edit the terms output args or array data?
- Build A Custom SQL Query for WordPress Search
- update_term_meta() only updating once on certain meta keys
- New term taxonomy and description in front page. Input’s
- How to show terms from another taxonomy
- How to display terms from two taxonomies in one php code?
- How to filter the terms to a special custom taxonomy?
- Select All not working in a WordPress search filter
- Get all the contents of taxonomy and sort by term
- ISOTOPE – Missing/Invalid Arguement Get Terms
- Three different queries on same page
- WordPress taxonomy and terms question
- Put ACF function output code the_terms
- How to allow searching a custom meta key in admin list table?
- How to order WP_User_Query results to match the order of an array of user IDs?
- Modifying widget search box
- Counting number of posts in a category and its sub categories and displaying result using shortcode
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- Use two WP Query in template
- Display Post co-authored in Author Page
- conditional statement for custom taxonomy
- Pass array of taxonomy terms to wp_query
- spliting posts into two columns
- WordPress – query 5 posts with a specific post in top
- Count the number of times the search form template gets included on a page
- esc_url returns incorrect URL
- How to get a list of all possible values of a specific user meta key?
- get_term_link() returns incorrect url
- Accessing the database from a plugin outside of action hooks
- Echo a hierarchical list of post data from custom fields
- How to make a search button that will search my website?
- Storing Array from returned database query and using the array in a new query
- get_the_tags() not iterating through for/while loop, but will with foreach
- What query string parameter is available for index.php, that works for both pages and blog articles?
- Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?
- wpdb php get_var query to get ID for URL image doesn’t work for ID over 999
- Insert term and child term from frontend
- Query if audio attachment AND/OR custom field
- edit search.php to include subdomain posts
- Search Query: how to construct a search string from two select elements?
- Odd / Even posts add class minus first post
- Category title output before opening title tag
- unable to use ‘new WP_Query’ in AJAX call
- Include Parent Term in wp_list_categories
- How to add div blocks after certain set of post
- Can I make get_users() query global?
- PHP -> SQL Query with Summing
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- Echo array value
- Filter unique custom field value based on custom taxonomy category or other custom field
- How to break up php code to avoid echo
- Query pulling a single post per month
- SQL error with custom query
- Hi need update in my terms for other taxonomy
- Free search and custom taxonomy query not providing the same result
- WordPress: Export/Import Yoast meta title & description to custom taxonomy
- Advanced Query posts
- Replace a single variable with add_filter
- How can I check that the acf field value is not a duplicate when adding a post?
- My Custom Post Type AJAX Query is Returning no posts – why?
- meta_query search names when they have middle initials
- Limit Search to Product Pages only unless I’m on Blogpage or Blogposts
- What is the correct way to search 3 custom fields only in WordPress?
- wp_set_object_terms returns 500 error when called through AJAX function
- getting the values of hidden inputs to use them in a php mysql query
- Query doesn’t display text data with apostrophes
- How to make a parent page for author.php?
- Display product attributes for current product
- How to enqueue assets only on queried pages, excluding the page being queried?
- Custom Search not working
- Make the text field in search form optional
- Displaying Results From Custom Taxonomy Query
- How to strip/remove all blank spaces at the beginning/end of a search string
- wp_query on search results page showing all results every time
- Is there a way of displaying related posts from lowest hyrachical order (lowest child category to parent category)
- Custom taxonomy with page post type – WordPress
- Search custom post type posts only by meta fields?
- SQL query to retrieve the number of WordPress posts with all given categories
- Limit a search box by CPT + taxonomies, in only one page
- Display posts based on the selected category when no subcategory is chosen