title: Category loop is showing all post titles (WordPress)
body: <p>I can't seem to get this to work properly.</p>
  <p>This code is supposed to loop through all categories in a custom taxonomy and show the post titles under each category heading:</p>
  <pre><code>$args = array(
      'post_type' =&gt; 'news',
      'taxonomy'  =&gt; 'news_category',
      'orderby'   =&gt; 'name'
  );
  $categories = get_categories( $args );
  foreach ( $categories as $category ) {
      $posts = get_posts($args);
      echo '&lt;h2&gt;' . $category-&gt;name . '&lt;/h2&gt;'; ?&gt;
      &lt;ul&gt;
          &lt;?php foreach($posts as $post) { ?&gt;
              &lt;li&gt;
                  &lt;?php the_title(); ?&gt;
              &lt;/li&gt;
          &lt;?php 
      } ?&gt;      
      &lt;/ul&gt;
  &lt;?php
  }
  </code></pre>
  <p>The expected result is this...</p>
  <p><strong>Category 1</strong></p>
  <ul>
  <li>A post title</li>
  <li>Another post title</li>
  </ul>
  <p><strong>Category 2</strong></p>
  <ul>
  <li>Yet another post title</li>
  </ul>
  <p><strong>Category 3</strong></p>
  <ul>
  <li>Hey look, another post title</li>
  <li>And one more post title just for fun</li>
  </ul>
  <p>...but what I am getting is this:</p>
  <p><strong>Category 1</strong></p>
  <ul>
  <li>A post title</li>
  <li>Another post title</li>
  <li>Yet another post title</li>
  <li>Hey look, another post title</li>
  <li>And one more post title just for fun</li>
  </ul>
  <p><strong>Category 2</strong></p>
  <ul>
  <li>A post title</li>
  <li>Another post title</li>
  <li>Yet another post title</li>
  <li>Hey look, another post title</li>
  <li>And one more post title just for fun</li>
  </ul>
  <p><strong>Category 3</strong></p>
  <ul>
  <li>A post title</li>
  <li>Another post title</li>
  <li>Yet another post title</li>
  <li>Hey look, another post title</li>
  <li>And one more post title just for fun</li>
  </ul>
  <p>How to I fix this?</p>