Take the tour ×  Essentially, I build web sites with galleries,
for photographers. Up until now, gallery images have all been
attached to posts and I've just pulled from the category
taxonomy. This is messy if it's also to be used as a regular
blog.  So I've been poking around and I discovered things like
if an attachment item isn't assigned to a post, it has a
parent_post ID of 0.  If I could, how would I go about simply
getting all items with a term in my custom taxonomy, ignoring
their parent_post IDs?  I'm getting the feeling Wordpress just
isn't quite there yet, for what I would like to do...
share|improve this question add comment  2 Answers  up vote 0
down vote accepted  If I understand right, you need all
attachments (attached or not) with specified term?  $args =
array(     'post_type'     => 'attachment',     'my_taxonomy' =>
'my_taxonomy_term'  $my_query = new WP_Query( $args );  if(
$my_query->have_posts() ):          // your stuff here  // Don't
forget to reset  WP_Query Taxonomy Parameters.  sh