Title: Get Taxonomy term using wp_query
Last modified: August 20, 2016

---

# Get Taxonomy term using wp_query

 *  [nvd80](https://wordpress.org/support/users/nvd80/)
 * (@nvd80)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/get-taxonomy-term-using-wp_query/)
 * Hi,
    i have a custom post type called **tours** with taxonomy called **tourtypes**
   and few terms i.e casual, adventure. My theme also have the option to choose 
   how many items to be displayed on a page.
 * The following code to query on the post type and no of item to be displayed. 
   What i couldnt figure out is how to display the specific term that user choose
   from the menu
 *     ```
       $paged = get_query_string_paged();
       $counter = 1;
       $terms = (get_query_var('terms')) ? get_query_var('terms') : 1;
   
       $posts_per_page = get_option('theme_show_tour_items');
           if($posts_per_page == "") {
              $posts_per_page = get_option('posts_per_page');
       				}
       $my_query = new WP_Query(array('post_type' => 'tours',  'tourtypes' => $terms, 'paged' => $paged, 'posts_per_page' => $posts_per_page));
   
       if ( $my_query->have_posts() ) : while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
       ...
       ```
   

The topic ‘Get Taxonomy term using wp_query’ is closed to new replies.

## Tags

 * [taxonomy](https://wordpress.org/support/topic-tag/taxonomy/)
 * [terms](https://wordpress.org/support/topic-tag/terms/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [nvd80](https://wordpress.org/support/users/nvd80/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/get-taxonomy-term-using-wp_query/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
