Title: Reply To: How to clone the global WP_Query object and change only one parameter?
Last modified: November 23, 2016

---

 *  Thread Starter [alexandrubau](https://wordpress.org/support/users/alexandrubau/)
 * (@alexandrubau)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/how-to-clone-the-global-wp_query-object-and-change-only-one-parameter/#post-8474751)
 * I’ve fixed it like so, but I don’t think it’s a good approach.
 *     ```
       $query = $wp_query->query_vars;
   
       $query['post_type'] = 'vehicle';
   
       $loop = new WP_Query($query);
       I don't know if it is the right approach but it works for me.
       ```
   
 * Let me know, what do you think.

## Tags

 * [main query](https://wordpress.org/support/topic-tag/main-query/)
 * [parameter](https://wordpress.org/support/topic-tag/parameter/)
 * [parameters](https://wordpress.org/support/topic-tag/parameters/)
 * [query](https://wordpress.org/support/topic-tag/query/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: alexandrubau
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/how-to-clone-the-global-wp_query-object-and-change-only-one-parameter/#post-8475634)

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
