Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #235176

    Hey folks. How would I go about changing the Popular posts to display popular posts only from the past 30 days, instead of all time?

    #236180

    Hey JoshMathis!

    The easiest solution would be to use a date query: http://codex.wordpress.org/Class_Reference/WP_Query#Date_Parameters which is supported since WP3.8.x. Open up wp-content/themes/sentence/framework/php/class-framework-widgets.php and replace:

    
    avia_get_post_list('cat=&orderby=comment_count&posts_per_page='.$posts);
    

    with

    
    			avia_get_post_list(
                        array(
                            'orderby'=> 'comment_count',
                            'posts_per_page'=> $posts,
                            'date_query' => array(
                                array(
                                    'column' => 'post_date_gmt',
                                    'before' => '1 month ago',
                                )
                            )
                        ));
    

    Regards,
    Peter

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.