get attachments for all posts of particular post type
It seems like a bit of a waste to run through two loops just to use some built in API functions that weren’t designed for a use case like this. I think you’re better off to use your SQL combined with the wpdb class — faster and cleaner. Example (with modified SQL): <?php function wpse52315_get_attach() … Read more