Multiple Loop and Comments problem
-
I am using code to display a loop within my main loop – before ym comments section. It work but the comments are not the comments from my main loop, they are from the last item in my loop within the loop. Here is a snippet of my code:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?><div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <?php the_title(); ?> <div class="storycontent clear music"> <?php the_content(__('(more...)')); ?> <?php if(in_category('20')) { ?> <h3>Track Listing</h3> <ol class="tracks"> <?php $post_title = get_post_meta($post->ID, 'post_title', $single = true);?> <?php $my_query = new WP_Query('category_name='.$post_title.'&order=des&showposts=100');while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate=$post->ID;?> <li><?php the_title();?></li> <?php endwhile; ?> </ol> <?php } else { ?> <?php } ?> </div> <?php comments_template(); // Get wp-comments.php template ?>
Any ideas as to why the comments are from the wrong loop?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Multiple Loop and Comments problem’ is closed to new replies.