Hello WordPress Blogger,
Here is another handy tips to show Most Commented Posts with Thumbnail. Many of you will be using any number of plugins or the database query that’s been doing the rounds recently to display your most popular posts. That code/plugin is no longer needed as WordPress’ query_post
scan now display your most commented posts.
<?php $popular = new WP_Query('orderby=comment_count&posts_per_page=10'); ?> <?php while ($popular->have_posts()) : $popular->the_post(); ?> <?php $justanimage = get_post_meta($post->ID, 'Image', true); // get an image if ($justanimage) { ?> <img src="<?php echo get_post_meta($post->ID, "Image", true); ?>" alt="<?php the_title(); ?>" /> <?php } else { ?> <img src="http://an-alternative-image.jpg" alt="" /> <?php } ?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php endwhile; ?>