Comments not working ??
-
Hello ??
I have a loop bringing the content of an article into my single.php template.
Then i have 3 commands…. one to display categories, a loop to display other articles and a recent comments command…
then under that in the html (but css’d to diplay along side the main article in a right-hand column), is the comments_template.
my problem is that the comments template is displaying comments from a different article. i’m sure it has something to do with the loops inbetween the end of the article and the comments template, altho i’m not sure how 2 remedy this…
all this can be seen here: https://tools.handcraftedserver.net/wordpress/?p=8 , for example…my code looks like this:
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<h2><?php the_title(); ?></h2>
<p id="small"><small>Written by <?php the_author() ?></small>
<?php the_content(''); ?>
<?php endwhile; endif; ?>
then i have the 3 other commands like so:
the categories
<ul>
<?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
</ul>
the recent comments
<ul>
<?php bdp_comments(); ?>
</ul>
and then the other articles
<ul>
<?php $posts = get_posts('numberposts=10'); foreach ($posts as $post) : setup_postdata($post); ?>
<?php if ( in_category(7) ) {} else { ?>
<li><a href= "<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<?php } endforeach; ?>
</ul>
then after that, i have the comments_template
<?php comments_template(); ?>
i look forward to getting some help from you guys.. thank you
- The topic ‘Comments not working ??’ is closed to new replies.