Anyone know about Popular Posts Plugin for WP version 2.51 I have downloaded one plugin which available but after installed when i try to activate it gives me some fatal error Appreciate if anyone suggest me good plugin for that which works properly for WP v.2.51 Thanks in advance. DON.
The following loop will get the 11 most commented on (thus popular) posts on your blog (WordPress only). Add this in your themes sidebar.php (or wherever you want the posts to appear - won't work in posts or pages without the ability to execute php in posts though). You will need to add css to make this fit your theme. <?php $now = gmdate("Y-m-d H:i:s",time()); $lastmonth = gmdate("Y-m-d H:i:s",gmmktime(date("H"), date("i"), date("s"), date("m")-1,date("d"),date("Y"))); $popularposts = "SELECT ID, post_title, post_date, comment_count, COUNT($wpdb->comments.comment_post_ID) AS 'popular' FROM $wpdb->posts, $wpdb->comments WHERE comment_approved = '1' AND $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND post_status = 'publish' AND comment_status = 'open' GROUP BY $wpdb->comments.comment_post_ID ORDER BY popular DESC LIMIT 11"; $posts = $wpdb->get_results($popularposts); $popular = ''; if($posts){ foreach($posts as $post){ $post_title = stripslashes($post->post_title); $post_date = stripslashes($post->post_date); $comments = stripslashes($post->comment_count); $guid = get_permalink($post->ID); $popular .= '<li><span class="title"><a href="'.$guid.'" title="'.$post_title.'">'.$post_title.'</a></span><br/><span class="meta">With <a href="'.$guid.'#commenting" title="Read the comments on '.$post_title.'">'.$comments.' comments</a> since '.$post_date.'</span></li> '; } }echo $popular; ?>
@kwebster - Tried your given code but its not working Blank space appear where i am trying to add your given code. Anyone else help me out of this problem DON.
If you are on wordpress then search for these terms in google " popularity contest plugin download" and you'll get what you are looking for. I would have posted the link to download myself but am replying from the phone. If you need professional services then I can help ya with it. Just pm me and I'll set it up asap after a minimal payment.
As i told earlier in my first post that i have downloaded that plugin but seems like its not working with latest wp version. Thats why looking for another plugin or code. DON.
It works fine if you tweak it a little bit, just search for the fix in google. I'm using it in my blog with 2.6.1 with no problems.
I had the same issue. I don't recall what I did to fix it. I think I had to perform a combination of the fixes to get it running. http://wpguy.com/tips/popularity-contest-plugin-compatibility-with-wordpress-25/ Nigel
Awesome! I am glad that you fixed it. Its quite weird that Alex didnt fix it even though everyone else could and did, I mean after all... its his plugin! And you are most welcome!
Yeap i am also surprised that why alex didn't fix it yet in that budle. BTW after fixed that fatal error issue i have fixed another issue (it display popular pages as well alongwith popular posts and i don't want to display pages there) with help of Nigel. Thanks Nigel for that DON.