Can I do Popular posts for past Week?
-
Long story short I am using the API (and some other things) to send the top 5 posts to a Category that then creates an RSS to send to Mailchimp. However, I only seem to be getting the top 5 posts ever…Is there a way for me to limit it to showing the Top 5 most popular posts of the Week?
I found this API:
$settings = array( 'daily' => TRUE, 'daily_range' => 30, 'limit' => 20, 'strict_limit' => FALSE, ); $topposts = get_tptn_pop_posts( $settings ); // Array of posts $topposts = wp_list_pluck( (array) $topposts, 'postnumber' ); $toppost_args = array( 'post__in' => $topposts, 'orderby' => 'post__in', 'posts_per_page' => 5, 'ignore_sticky_posts' => 1 );
I based it on what I found here https://webberzone.com/plugins/top-10/ But I do not see any documentation on this. I would assume, for example, that ‘daily_range’ => 30 would mean 30 days…but I’m seeing posts that are 7 months old. Unless does this mean posts that were viewed in the last 30 days? Or does it mean posts that are 30 days old? Is there documentation for any of this stuff?
- The topic ‘Can I do Popular posts for past Week?’ is closed to new replies.