WordPress.org

Ready to get started?Download WordPress

Forums

Post tags with query_posts (3 posts)

  1. rpophessagr
    Member
    Posted 4 years ago #

    Hi,

    I'm using wordpress 2.8.5

    I'd like to show 11 instead of 10 posts on my archive pages. The problem is that query_posts seems to mess up the post tags showing the same posts for any tag clicked on.

    I had problems with pagination as well but found a good solution here:
    http://stylizedweb.com/2008/08/13/query_posts-pagination-problem/

    Any ideas?

    Thanks!

  2. MichaelH
    Member
    Posted 4 years ago #

    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;
  3. rpophessagr
    Member
    Posted 4 years ago #

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic