• 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)
  • 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.