Situation: my client has this simple gallery built with WP_Query showing the latest media added to the site:
$cola = new WP_Query( array( 'post_type' => 'attachment', 'post_status' => 'inherit', 'posts_per_page' => 15, 'post_mime_type' => 'image/jpeg', 'orderby' => 'date' ));
that's working perfect. Except for now we're using AdRotate and want to display ads on the website, but we don't want these ads to be added to the query above.
A simple solution for this would be to only fetch media that is attached to a post/page, since ads never get attached to anything. This would be achievable by using
post_parent: array(_of_all_post_ids) - except that we already have about 4k posts now, so this is definitely not a good approach.
Any ideas how to go about that?
Note: my client is not a techie so this is why i'm ruling out using FTP to use the banner folder AdRotate creates on wp-content. For their planned use, the media gallery would be perfect for the ads.