‘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?
- Need help with Query Loop. Need to get current taxonomy term and its posts and group them by a different selected taxonomy term
- Custom taxonomy in WP_Query not working
- get_the_terms has strange result since version 6.0
- 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
- Any quicker alternative for WP_Query “NOT IN”
- Exclude post with taxonomy and from the terms (taxonomy & tag) posts count
- Tax Query on product_cat using NOT IN as operator does not exclude that category
- Use get_cat_ID to retreive multiple category IDs
- Strange behaviour of hierarchical taxonomy archive
- Facing problem with tax_query results
- Display related CPT with custom taxonomy
- display ACF repater field in archive page
- tax_query not working on custom post type
- 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
- WooCommerce WP_Query using tax_query returns no results (0 = 1)
- Display Custom Post Type Based on Taxonomy With WP_Query()
- Get categories within specific term
- WP_Query paginate with one term per page?
- WordPress – Form does not filter the results of taxonomies
- Select multiple categories with is_tax
- list all post who have mutual taxonomy as current taxonomy!
- How to display Woocommerce products list by tag
- Why pagination is not working with tax_query param?
- WordPress post_status and meta_query
- Show one post of each custom taxonomy
- Query child posts with tax query on parents
- How to break up output of posts for different terms on same page?
- posts_per_page in a tax_query
- Tax_Query not working – connecting to second wordpress database
- Custom category page with taxonomy filters
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- pages shortcode filtering by category
- WordPress tax_query ignoring relation OR
- get term objects and post objects in query
- 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
- 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
- Woocommerce orderby rand with tax_query not random
- 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
- Escaping WP_Query tax_query when term has special character(s)
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- Custom query for tag and custom tag from 2 post type
- 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
- Search format not matching taxonomy query
- Add a custom variable to query page object
- List posts of terms but exclude one term
- How to get several fields from wp_query?
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?