Comment count not working
-
I can’t get comment counts to work. I tried comments_popup_link and comments_number but they always show no comments. This is on a page using query_posts. I saw the https://www.ads-software.com/support/topic/162559 is_page fix but it does not work. I thought it might be query_posts but I saw several examples using comments_popup_link so I assume that it should work. Here is my code in question:
<div id="content" class="narrowcolumn"> <?php $temp_query = $wp_query; ?> <?php query_posts($query_string.'showposts=200&orderby=date&order=DESC&cat=-16'); ?> <ul id="ArticleList"> <?php while (have_posts()) : the_post(); ?> <li class="post" id="post-<?php the_ID(); ?>"> <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3> <?php global $post; $default_size = 'medium'; $attachments = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID', 'numberposts' => 1) ); if($attachments) : foreach($attachments as $id => $attachment) : $img = wp_get_attachment_image_src($id, $default_size); endforeach; else : $img=null; endif; ?> <a href="<?php the_permalink() ?>"><img src="<?php echo ($img[0]);?>" alt="<?php the_title(); ?>" /></a> <small>By <a href="mailto:<?php the_author_email();?>"><?php the_author_firstname(); ?> <?php the_author_lastname(); ?></a></small> | <small>Date posted: <?php the_date(); ?></small><br /> <span class="NumComments"><a href="<?php the_permalink(); ?>#comments"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></a> </span> <ol class="commentlist"> <?php wp_list_comments(); ?> </ol> <p><?php the_excerpt(); ?></p> </li> <?php endwhile; ?> </ul> </div>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Comment count not working’ is closed to new replies.