I’m using the comments_popup_link()
function to show the number of comments for each post in a loop.
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if ( get_post_meta($post->ID, 'thumb_value', true) ) : ?>
//something
<?php else: ?>
//something else
<?php endif; ?>
<h2><a href="https://wordpress.stackexchange.com/questions/4658/<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php the_content(__('Read more'));?>
<div class="post-meta">
<?php the_time('F j, Y'); ?>
<p>Category: <?php the_category(', '); ?></p>
<p><?php the_tags(); ?></p>
<p><?php comments_popup_link('Post Comment', '1 Comment', '% Comments'); ?></p>
</div>
<?php endwhile; ?>
<?php $wpdb->show_errors();
$wpdb->print_error(); ?>
<?php else: ?>
<p><strong>There has been an error.</strong></p>
<?php $wpdb->show_errors(); ?>
<?php $wpdb->print_error(); ?> </p>
<?php endif; ?>
Everything displays fine but I get
WordPress database error: [] SELECT *
FROM wp_comments WHERE comment_post_ID
= 216 AND comment_approved = ‘1’ ORDER BY comment_date_gmt DESC
I’m just curios why I get that..