Most Commented Posts

< ul>
<?php
$result = $wpdb->get_results(“SELECT comment_count, ID, post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 10”); // NUMBER OF POSTS
foreach ($result as $topten) {
$postid = $topten->ID;
$title = $topten->post_title;
$commentcount = $topten->comment_count;
if ($commentcount != 0) {
?>
< li>< a rel=”nofollow” href=”<?php echo get_permalink($postid); ?>”><?php echo $title ?>< /a></ li>

<?php } } ?>
< /ul>


Most Commented