you are in: codestackercodes [RSS]wordpress popular posts

wordpress popular posts Delicious Email

show/hide lines
   1  <ul>
   2  <?php $result = $wpdb->get_results("SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 5");
   3  foreach ($result as $post) {
   4  setup_postdata($post);
   5  $postid = $post->ID;
   6  $title = $post->post_title;
   7  $commentcount = $post->comment_count;
   8  if ($commentcount != 0) { ?>
   9  <li><a href="<?php echo get_permalink($postid); ?>" title="<?php echo $title ?>">
  10  <?php echo $title ?></a> {<?php echo $commentcount ?>}</li>
  11  <?php } } ?>
  12  </ul>
created by leozera — 22 August 2009 — get a short url — tags: php wordpress embed

Comments



We dont send spam :)

If checked, it's highlights your comment
simple_captcha.jpg
Are you a human? Type the code from the image