Popular articles in sidebar?
-
Hello,
I would like to preview the most popular articles in the sidebar, but no luck. Right now, it’s most viewed by comment count.
Any suggestions?
<?php $popular_posts = $wpdb->get_results("SELECT id,post_title FROM {$wpdb->prefix}posts ORDER BY comment_count DESC LIMIT 0,10"); foreach($popular_posts as $post) { print "<li><a href='". get_permalink($post->id) ."'>".$post->post_title."</a></li>\n"; } ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Popular articles in sidebar?’ is closed to new replies.