WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
Exclude posts published more than x days (3 posts)

  1. Damien Saunders
    Member
    Posted 2 years ago #

    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/

  2. H├ęctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Damien,

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

  3. alexvorota
    Member
    Posted 2 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic