How to run WP_Query to retrieve attachments to posts only from a particular category?
You’ll need to first grab the posts, then grab the attachments that are children of said posts. $my_query = new WP_Query( array( ‘meta_key’ => ‘my_hash’, ‘nopaging’ => true, ‘orderby’ => ‘meta_value’, ‘fields’ => ‘ids’, ‘cat’ => ’60’, )); if ( $post_ids = $my_query->get_posts() ) { $post_ids = implode( ‘,’, $post_ids ); $atts_ids = $wpdb->get_col( “SELECT … Read more