Skip to content

Instantly share code, notes, and snippets.

@thefrosty
Created January 23, 2015 18:15
Show Gist options
  • Save thefrosty/ba90b2ba4d0c5e823991 to your computer and use it in GitHub Desktop.
Save thefrosty/ba90b2ba4d0c5e823991 to your computer and use it in GitHub Desktop.
Get popular downloads for recent XX days. Easy Digital Downloads.
@thefrosty
Copy link
Author

I'm going to follow up and say my use is a special use case. I've moved outside of downloads as my post type. I ended up figuring it out after a quick break. Since I've got multiple post types that use downloads for the front end I was using CPT-onomies to tie them together. This is the $args I had to update to:

$query_args = array(
            'post_type'         => 'plugin',
            'post_status'       => 'publish',
            'posts_per_page'    => 6,
        #   'post__in'          => $post__in,
            'suppress_filters'  => false,
            'tax_query'         => array(
                array(
                    'taxonomy'  => 'download', // EDD download post_type (CPT connection)
                    'field'     => 'id', // can be slug or id - a CPT-onomy term's ID is the same as its post ID
                    'terms'     => $post__in 
                )
            )
        );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment