Most commented / popular posts and offset

I am using this code to show 3 most popular posts based on number of comments : <?php $pop_posts = 3; $popularposts = “SELECT $wpdb->posts.ID, $wpdb->posts.post_title, COUNT($wpdb->comments.comment_post_ID) AS ‘stammy’ 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 stammy DESC LIMIT “.$pop_posts; $posts = $wpdb->get_results($popularposts); if($posts){ … Read more

How to install WordPress Popular Posts plugin twice?

I’ve installed WordPress Popular Posts plugin but found that it displays popular posts only from category. I want to display popular post for custom taxonomy. I found some hack in that plugin. Plugin might be work with custom taxonomy replacing category to custom taxonomy name. So I’m thinking to install same plugin twice with minor … Read more

Sort Popular Posts by Views for the Last Week

I’m trying to sort the popular posts so it shows the most visited in the last week, but it hasn’t worked. Anyone have an idea of why it isn’t working? <?php $popularpost = new WP_Query( array ( ‘posts_per_page’ => 5, ‘ignore_sticky_posts’ => 1, ‘meta_key’ => ‘sw_post_views_count’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘DESC’, ‘date_query’ => array … Read more