‘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?
- tax_query in get_posts() not working?
- 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 list of posts which have at least one term from a custom taxonomy with WP_Query
- if wp_query taxonomy term have posts
- Get random terms
- 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?
- List all custom post type posts from a given category?
- WP_Tax_Query with post_tag not working
- Filtering posts by custom field value not working
- 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?
- WordPress Related Post by tags in Single.php
- is_tax() function not working as expected
- Advanced Taxonomy Queries WordPress
- How to order posts by title after they have already been sorted by category
- Taxonomy and Date in same query?
- Query with meta_query and tax_query together not working properly
- Adding a tax_query to a WP_Query Object
- Filter Custom Taxonomy Posts
- Order or Orderby in tax_query (How to define order of terms in WP_Query)
- Using custom taxonomies in a query
- get_the_terms – but only show 4 Posts
- Count posts per taxonomy else change taxonomy if less than x number
- get term id from term name
- WP_Query to output chosen term and posts with no term assigned
- exclude product with available tag
- How to add tax_query to $args with concatenation
- How to echo woocommerce category name
- Is it possible to add relation between meta_query and tax_query?
- WP Query – filtering terms with regex
- relation OR instead of AND – Filtered term ID’s in loop
- Avoid WP_Query’s duplicate posts with taxonomies
- How can I do a orderby by the number of items? So basically list by starting with the array with the largest number of post
- Exclude post with taxonomy and from the terms (taxonomy & tag) posts count
- Facing problem with tax_query results
- Get categories within specific term
- How to display Woocommerce products list by tag
- WordPress post_status and meta_query
- Tax_Query not working – connecting to second wordpress database
- Optimal way to make tags in tax_query optional?
- in tax_query this Is the code correct? I need to access beginner video posts for different subject
- display all posts from category with and without terms in chronological order
- WP Query with sticky posts and tax_query
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- WP_Query: Meta_Query with serialized value (or a workaround)
- Multiple tax_queries: display posts titles from several custom taxonomie
- Escaping WP_Query tax_query when term has special character(s)
- How to get hierarchical number of custom taxanomy
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Displaying Results From Custom Taxonomy Query
- WP_Query with tax_query not working
- Custom query with custom filtering returning incorrect results