‘terms’ => array(‘$tags1’),
Remove the single quotes and it should look like
‘terms’ => array($tags1) OR ‘terms’ => $tags1
No need to make it an array, if you are using just one value.
Related Posts:
- Why is my WP_Query not working when tax_query terms are an array?
- WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)
- Change default ordering of taxonomy terms – pre_get_terms
- Is it possible to dynamically get queried term AND taxonomy?
- Empty tax_query array returns an empty array
- Pass array of taxonomy terms to wp_query
- Get list of terms that have posts in another term
- Formulate a url to show posts with both taxonomy terms
- Taxonomy search/filter with multiple taxonomies and multiple taxonomy terms
- Order by slug in get_terms with multiple taxonomies
- Function get_queried_object() return NULL in custom taxonomy
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- Return Taxonomy/Term Information with Posts (WP_Query/get_posts)
- Get authors by term id or slug
- Custom post taxonomies as tax_query terms?
- WP_Query tax query part of slug
- Taxonomy Query Relation field not behaving correctly?
- Taxonomy order exception for specific term
- Get posts from multiple tax terms
- How to Order a list of taxonomies? orderby?
- How to add custom meta to ‘pre_get_terms’?
- 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
- 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
- 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 can I order a post query’s results based on the number of matching taxonomy terms?
- WP Query should show No Posts when tax_query $args taxonomies don’t have associated posts
- Only show tag with the same id as the post
- Save queried result into database
- wp_query with meta_query and tax_query
- taxquery taxonomy get terms
- How to show terms from another taxonomy
- How to define a custom hierarchy for terms?
- 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
- How can I get taxonomy term name using term slug & post ID using build in WordPress function or class?
- Nested meta_query with multiple relation keys
- Multiple relationship for multiple tax_query in WP_Query
- Conditional arguments for WP_Query and tax_query depending on if $somevar has a value
- WP query taxonomy input differs to output?
- Does tax_query really beats meta_query in all situations?
- get_terms with posts that have a different taxonomy with term x
- Get list of posts which have at least one term from a custom taxonomy with WP_Query
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- Get random terms
- Find all product that contain terms with %keywords% in WP_Query
- Get term by custom term meta and taxonomy
- Filter and list posts of a custom taxonomy
- tax_query: What to pass when I want to have all terms?
- WP Query – Get WooCommerce Products with variation that is in stock
- WP_Tax_Query with post_tag not working
- Filter WordPress posts by between parameter
- How to Modify Taxonomy Archive Page with Search Parameter?
- Filtering posts by custom field value not working
- Display link to taxonomy archive only if it has posts with certain custom field values
- tax_query OR with empty result returns all posts
- tax_query returning all posts instead of selective posts in WP_Query
- tax_query: Order by slug?
- Tax query clause inside a meta query clause?
- is_tax() function not working as expected
- Fetch posts that match term slug first two letters (wp query)
- How to order posts by title after they have already been sorted by category
- Post loop for all taxonomy terms
- Taxonomy and Date in same query?
- How Can I Change The Tax Query For The Main Loop For Taxonomy Archives?
- Finding WordPress Posts assigned to multiple categories
- Tax Query only returns for the first of several terms
- Using WP_Query for categories instead of get_terms
- Grabbing taxonomy terms and inserting them into an array
- 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
- Any quicker alternative for WP_Query “NOT IN”
- Tax Query on product_cat using NOT IN as operator does not exclude that category
- 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 by 4 different taxonomies
- Select multiple categories with is_tax
- list all post who have mutual taxonomy as current taxonomy!
- Why pagination is not working with tax_query param?
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- pages shortcode filtering by category
- get term objects and post objects in query
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- 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 get several fields from wp_query?
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Multiple Orderby is not working right
- I need to get all categories from a WP_Query
- Adding a language rule and displaying posts with a custom taxonomy term on its archive page
- Filter on one post type with taxonimy and get other post type
- Custom tag template to list posts in ASC order