This function below creates a list of links of the top commented posts on your Wordpress blog. It builds this list based on the posts that have the most comments. Place it in your footer or sidebar item!

<?php
function listPopularPosts() {
    global $wpdb;
    $strBuidler = '';
	
    $result = $wpdb->get_results("SELECT comment_count, ID, post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 5");
	
    foreach ($result as $post) {
	setup_postdata($post);
	$postId = $post->ID;
	$title = $post->post_title;
	$commentCount = $post->comment_count;
		
	if ($commentCount != 0) {
		$strBuidler .= '
  • '; $strBuidler .= '' . $title . ' '; $strBuidler .= '(' . $commentCount . ')'; $strBuidler .= '
  • '; } } return $strBuidler; } ?>

    Call the function in your sidebar of footer like this:

    <?php _e('Popular Posts'); ?>

      <?php echo(listPopularPosts()); ?>