Bump, does anyone have any idea?
I’d like to know this one as well. I have been struggling with this a little. I have a category of post that I would like to be added to a page after the content of that page. However I cannot get this query to run nor display.
Even though you endwhile; on the custom loop it is still active (as you can see by the comment behaviour). You need to re-enter the normal loop.
The only way I’ve been able to do it is by sticking
while(have_posts()) { the_post(); }
after the endwhile; for the custom loop.
Perhaps if that goes askew you should even end the main loop before the custom loop and then start it again.
I found a solution and posted it here. Maybe it helps you as well:
http://ww.wp.xz.cn/support/topic/276637?replies=2
(@nielskreijveld)
17 years ago
Hello people.
I’m working on a theme that has a normal loop on the single.php page. After this loop, there is a custom WP_query loop that displays some posts from another category. Then after these posts the comments template should show up. My code is as follows:
The comments template shows up, but it is “linked” to the last post of the custom query (the last post from category 6). So when I post a comment, it actually gets posted to a different post (in category 6).
I’ve tried adding <?php $wp_query = $temp_query; ?> before the custom loopt and <?php $temp_query = $wp_query; ?> after it, but that didn’t help.
How do I fix this?