• 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?

Viewing 1 replies (of 1 total)
  • Plugin Author Ajay

    (@ajay)

    It is the posts that are viewed in the top 30 days and not the posts published in the last 30 days. So you will have posts older that 30 days.

    The documentation is pending. I haven’t had the time to pull together full fledged documentation.

    You could potentially use the date parameters of WP_Query to only show posts after a certain date

Viewing 1 replies (of 1 total)
  • The topic ‘Can I do Popular posts for past Week?’ is closed to new replies.