Title: adding tax_query to $query_string
Last modified: January 2, 2017

---

# adding tax_query to $query_string

 *  [roakin](https://wordpress.org/support/users/roakin/)
 * (@roakin)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/adding-tax_query-to-query_string/)
 * I need to adjust the query in the loop.php by adding tax_queries based on $REQUEST
   params. i tried something like this
 *     ```
       $argsExtended = array(
       	'tax_query' => array(
       		array(
       			'taxonomy' => 'my_custom_tag',
       			'slug' => 'slug',
       			'terms' => array( 'my_tag_slug' ),
       			'operator' => 'in',
       		),
       	)
       );
       $args = array_merge( $wp_query->query_vars, $argsExtended );
       query_posts( $args );
       ```
   
 * but this doesn’t seem to work. Any ideas?

Viewing 1 replies (of 1 total)

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [9 years, 4 months ago](https://wordpress.org/support/topic/adding-tax_query-to-query_string/#post-8609840)
 * loop.php is a theme-specific file, if it exists at all.
 * The proper way to modify is usually through pre_get_posts().
 * [https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts](https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts)

Viewing 1 replies (of 1 total)

The topic ‘adding tax_query to $query_string’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/adding-tax_query-to-query_string/#post-8609840)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
