You can use below code to search in taxonomy. First using name__like
in get_terms
it will return all terms ids which have $keyword then that ids use in wp_query
.
$termIds = get_terms([
'name__like' => $keyword,
'fields' => 'ids'
]);
$args = [
'post_type' => 'movies',
'tax_query' => [
[
'taxonomy' => 'actors',
'field' => 'id',
'terms' => $termIds,
]
]
];
$query_loop = new WP_Query($args);
Related Posts:
- Why is my WP_Query not working when tax_query terms are an array?
- How to add terms to my tax_query based off of the current post
- Is it possible to dynamically get queried term AND taxonomy?
- Taxonomy Query Relation field not behaving correctly?
- Get posts in taxonomy randomly
- Loop posts based on permalink term
- Show multiple tax_query from 2 or more post_type in a single code
- WP Query should show No Posts when tax_query $args taxonomies don’t have associated posts
- wp_query with meta_query and tax_query
- How can I get all the posts that are related with a specific taxonomy term?
- Custom taxonomy and query multi conditions
- Empty ‘terms’ in ‘tax_query’ returns an empty array
- Get the tax term in which is a post via wp_query
- Custom query for certain post type OR another post type with a certain category
- WordPress tax_query “and” operator not functioning as desired
- Search custom taxonomy term by name
- Escaping WP_Query tax_query when term has special character(s)
- How to display post from current Taxonomy in archive page?
- Display posts the match taxonomy term linked from wp_list_categoies?
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- How to combine tax_query and date_query in WordPress
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- Using tax_query reverses my post_type argument in a custom WP_Query
- WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)
- tax_query shows no results if nothing is selected
- get complex results set according to category structure
- WP_Query tax_query problem
- Filtering posts by custom field value not working
- Change default ordering of taxonomy terms – pre_get_terms
- Order taxonomy terms in alphabetical order
- Empty tax_query array returns an empty array
- How do I search inside specific taxonomies in WordPress
- Pass array of taxonomy terms to wp_query
- Formulate a url to show posts with both taxonomy terms
- tax_query: Order by slug?
- Taxonomy search/filter with multiple taxonomies and multiple taxonomy terms
- Output an array of terms for a ‘tax_query’ => array()
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- WP_Query Not Recognizing Taxonomy Parameter in Custom Search
- Return Taxonomy/Term Information with Posts (WP_Query/get_posts)
- Advanced Taxonomy Queries WordPress
- How can I filter by slug depending on language selection
- WP Query Args – Title or Taxonomy Value
- Slow queries on a huge database
- Search Query for multiple categories using ‘OR’ but having certain categories be ‘AND’
- wp_query args adding muitiple tax_querys
- Automatically Query Parent Taxonomy
- Redirect to another page using contact form 7? [closed]
- How Can I Change The Tax Query For The Main Loop For Taxonomy Archives?
- Custom taxonomy.php not working
- WP_Query for a taxonomy with different taxonomy types
- Finding WordPress Posts assigned to multiple categories
- Order or Orderby in tax_query (How to define order of terms in WP_Query)
- Get posts from multiple tax terms
- How to Order a list of taxonomies? orderby?
- How to add custom meta to ‘pre_get_terms’?
- Tax Query only returns for the first of several terms
- Get Child Category only
- WP Job Manager plugin – Listing only the twelve job categories on frontpage order by jobs they have
- How to print term name inside wp post loop
- how to get category`s slug in WP_Query loop?
- How to search for meta_query LIKE or tax_query LIKE and grab these posts on search results?
- Function using get_posts() with tax_query not working when called from functions.php
- Running a custom query inside another cpt single and trying to grab a variable
- Don’t repeat posts from children in parent taxonomy query
- Tax_Query using WP_Query not working
- Custom taxonomy in WP_Query not working
- Can’t get term id for category archive
- How to make a post with certain taxonomy term display first before other post with only one query?
- How to search by slug and old slug in single API
- Any quicker alternative for WP_Query “NOT IN”
- Tax Query on product_cat using NOT IN as operator does not exclude that category
- Use get_cat_ID to retreive multiple category IDs
- How can I order a post query’s results based on the number of matching taxonomy terms?
- Only show tag with the same id as the post
- How to use the Term Object from a custom select field in a query
- WP_Query for a taxonomy value OR a custom post type meta field
- WP_Query paginate with one term per page?
- Select multiple categories with is_tax
- list all post who have mutual taxonomy as current taxonomy!
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- pages shortcode filtering by category
- WordPress tax_query ignoring relation OR
- How to show terms from another taxonomy
- Taxonomy Terms That Don’t Exist Display Results
- display all posts from category with and without terms in chronological order
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- Category Archive not working for pages
- How to combine nested tax_query logic with other nested query logic?
- WP Query with sticky posts and tax_query
- tax_query not working for taxonomy slug
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- Custom query for tag and custom tag from 2 post type
- Search format not matching taxonomy query
- List posts of terms but exclude one term
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Advanced AND tax_query in sidebar with 2 taxonomies
- Output ACF field dynamicaly within a taxonomy loop [closed]
- tax_query not working properly with get_posts
- Custom query with custom filtering returning incorrect results