WordPress.org

Support

Support » Themes and Templates » Post tags with query_posts

Post tags with query_posts

Viewing 2 replies - 1 through 2 (of 2 total)
  • Example of getting the_tags to work in a custom query

    <?php $my_query = new WP_Query('showposts=10'); ?>
    global $wp_query;
    $wp_query->in_the_loop = true;  
    
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
            <?php the_title(); ?>
    
            <div class="def"><?php the_content(); ?></div>
        	<?php the_tags(); ?>
    
    <?php endwhile; ?>

    You might need these;

    global $wp_query;
    $wp_query->in_the_loop = true;

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Post tags with query_posts’ is closed to new replies.