WordPress.org

Support

Support » Plugins and Hacks » WordPress Popular Posts » [Plugin: WordPress Popular Posts] Exclude posts published more than x days

[Plugin: WordPress Popular Posts] Exclude posts published more than x days

  • Hi there

    this is a suggestion for WPP which I think would really help lots of people.

    If try to write regularly, and at the end of each month, I like to share a post of my most popular posts.

    The feature I’d like to see added is to show the most popular posts – but only if they were first published in the last 30 days.

    Is this something you would considered adding please?

    thanks

    Damien

    http://wordpress.org/extend/plugins/wordpress-popular-posts/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Hector Cabrera

    @hcabrera

    Hi Damien,

    Thanks for your suggestion. I’ll see what I can do!

    I needed the same functionality and I done it in this way (wordpress-popular-posts.php line 619):

    $published_days_ago = " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'";
    			$mostpopular = $wpdb->get_results("SELECT $wpdb->posts.ID, $wpdb->posts.post_title $fields FROM $wpdb->posts $join WHERE $wpdb->posts.post_status = 'publish'   AND $wpdb->posts.post_password = ''  $published_days_ago  AND $range $force_pv $nopages $exclude GROUP BY $wpdb->posts.ID ORDER BY $sortby DESC LIMIT " . $instance['limit'] . "");

    ————————————

    The complete code wordpress-popular-posts.php with the ability to specify the number of days on a widget page ( On the WPP Stats page (/wp-admin/index.php?page=wpp-stats-display) not work exclude for published time )

    http://snipt.org/uLW7#expand

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WordPress Popular Posts] Exclude posts published more than x days’ is closed to new replies.
Skip to toolbar