Hi there,
i used this function to show the most-commented posts in my blog.
<?php $result = $wpdb->get_results("SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 3");
foreach ($result as $post) {
setup_postdata($post);
$postid = $post->ID;
$title = $post->post_title;
$commentcount = $post->comment_count;
if ($commentcount != 0) { ?>
<div class="mostCommentedBox">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> <?php
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail();
} else { ?>
<img src="<?php bloginfo('template_directory'); ?>/images/noimage.jpg">
<?}?> </a>
<strong><a href="<?php echo get_permalink($postid); ?>" title="<?php echo $title ?>"><?php echo $title ?></a></strong>
<div class="mostCommentedBoxCommetsCount" title="<?php echo $commentcount ?> comments"><?php echo $commentcount ?></div>
<p><?php the_excerpt(); ?></p>
</div>
<?php } } ?>
but for some reasone i don't see the excerpt at all....
i'm sure it's something stupid i'm missing... help, anyone? :-)