title: Wordpress: Getting images by 'category' taxonomy
body: <p>I have the following code and im trying to get the images by category, I have a category name "home-hero" and when I add it into the following code it still displays all the images in the media.</p>
  
  <p>How can i get it to only display all the images under home-hero?</p>
  
  <pre><code>&lt;?php
  function get_images_from_media_library() {
    $args = array(
      'taxonomy' =&gt; 'home-hero',
      'post_type' =&gt; 'attachment',
      'post_mime_type' =&gt;'image',
      'post_status' =&gt; 'inherit',
      'order'    =&gt; 'DESC'
    );
    $query_images = new WP_Query( $args );
    return $query_images;
  }
  
  function display_images_from_media_library() {
    $imgs = get_images_from_media_library();
    $html = '&lt;div id="media-gallery"&gt;';
    global $post;
    if ($imgs-&gt;have_posts()) {
      while($imgs-&gt;have_posts()) {
        $imgs-&gt;the_post();
        $html .= '&lt;img src="' . $post-&gt;guid . '" alt="" /&gt;';
        $html .=  get_the_date('F j, Y');
      }
    }
    $html .= '&lt;/div&gt;';
    return $html;
  }
  echo display_images_from_media_library();
  ?&gt;
  </code></pre>
  
  <p>Thanks for taking the time to ready.</p>