Title: Query_Posts Question
Last modified: August 19, 2016

---

# Query_Posts Question

 *  [JSauce16](https://wordpress.org/support/users/jsauce16/)
 * (@jsauce16)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/query_posts-question-5/)
 * I use the below query on my category template. I would like to use something 
   similar on my tags template. How would I modify this to get posts from a particular
   tag?
 * I assume it has to do with changing ‘cat’ to something else…
 *     ```
       <?php
       	query_posts(array(
                 'cat' => get_query_var('cat'),
       	  'post_type' => array( 'post', 'premier' ),
       	  'order' => 'ASC',
                 'orderby' => 'title',
                 'posts_per_page' => -1,
       ```
   

Viewing 1 replies (of 1 total)

 *  [jennamolby](https://wordpress.org/support/users/jennamolby/)
 * (@jennamolby)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/query_posts-question-5/#post-2027185)
 * This is what I use. Slightly different than what you posted:
 * <?php
    $args=array( ‘category’ => ‘CAT’, ‘post_type’ => array( ‘post’, ‘premier’),‘
   post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘caller_get_posts’=> 1 ); 
   $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts()){
   while ($my_query->have_posts()) : $my_query->the_post(); ?>
 * Where ‘Cat’ = the category Name.

Viewing 1 replies (of 1 total)

The topic ‘Query_Posts Question’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [jennamolby](https://wordpress.org/support/users/jennamolby/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/query_posts-question-5/#post-2027185)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
