title: Wordpress - Getting posts in a custom taxonomy
body: <p>Ive been struggling with a wordpress issue for a few weeks now and i just cant figure it out.</p>
  
  <p>I have created a custom post type called 'cpt_used', in that custom post type i have created a custom taxonomy called 'tax_used', which is a categories list</p>
  
  <p>What i need to do is show all posts that belong to each custom taxonomy and i just cant figure it.</p>
  
  <p>the code i have at the moment is as follows, there are multiple posts in each of the categories, but its just not displaying anything</p>
  
  <pre><code>$args = array(
      'orderby' =&gt; 'name',
      'hide_empty' =&gt; 0,
      'taxonomy' =&gt; 'tax_used'
  );
  $categories = get_categories($args);
  
  foreach( $categories as $category ) {
  
      $newargs = array(
          'category_name' =&gt; $category-&gt;slug,
          'taxonomy' =&gt; 'tax_used',
          'term' =&gt; 'cpt_used'
      );
  
      query_posts( $newargs );
      if (have_posts()) :
          while (have_posts()) : the_post();
              the_title();
          endwhile;
      endif;
  
  }
  </code></pre>