Loop and Commment Solution
-
I’m trying to get my comments for a post to work correctly while operating a loop within a loop.
The loop within a loops purpose is to create a main post that has a sub-journal. That sub-journal is a list of posts associated with the post. I have the loop within the loop working on posts; however, I would like for comments to be available on the main post.
The primary loop is, I belive, pretty standard code, I will include the html too:
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <p class="postmetadata"><?php the_time('m.d.y') ?> - <?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p> <div class="post_entry"> <?php the_content('read more »'); ?> <?php wp_link_pages(); ?> </div> <div id="comments"> <?php comments_template(); // Get wp-comments.php template ?> </div> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('« Older Entries') ?></div> <div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div> </div> <?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?> <?php endif; ?>And this is the code I post within a post through WordPress (Exec-PHP plugin activated):
<?php $my_query = new WP_Query('tag=Eng-4+Notes'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?> <?php the_title(); ?>: <?php the_time('m.d.y') ?> <?php the_excerpt_reloaded(200, '<img><p>', '', TRUE, '', FALSE, 1); ?> <?php endwhile; ?>Now again, the main post and sub-posts generate, but the current comments for the main posts does not appear. Here is a link to the page (one single entry under Class Journal, I may be editing it too:
http://joelsimone.com/content/?p=43So, how do I get comments working? Is it possible?
Thanks!
The topic ‘Loop and Commment Solution’ is closed to new replies.