How to show most commented posts in WordPress

How to show most commented posts in WordPress

In this tutorial we are showing How to list most commented posts in WordPress using your custom query below code is there you just copy and make it your.

PHP code for show most commented posts in WordPress

<?php
$popular = new WP_Query( array(
    'post_type' => array( 'post' ),
    'showposts' => 6,
    'ignore_sticky_posts' => true,
    'orderby' => 'comment_count',
    'order' => 'dsc'
));
while ( $popular->have_posts() ): $popular->the_post();
the_title();
endwhile;
?>
About Author

My name is Mukesh Jakhar and I am a Web Application Developer and Software Developer, currently living in Jaipur, India. I have a Master of Computer Application in Computer Science from JNU Jaipur University. I loves to write on technology and programming topics. Apart from this, I love to travel and enjoy the beauty of nature.

Sign up for weekly update

Milkshake is almost ready. If you're interested in testing it out, then sign up below to get exclusive access.