title: Dynamically display posts by one author AND from one category on the same page?
body: <p>I'm trying to edit my author.php wordpress template so that it shows posts by any one author, but only from one particular category. So far, I've been trying the query_posts function which fetches the category okay, but not the author. Depending on which way I do it, so far the posts either don't display at all or all posts in that category appear regardless of the author.</p>
  
  <p>This is the appropriate code which I've seen quoted by a wordpress.org admin, but it doesn't work for me and I can't find any other examples. Any ideas why that doesn't work? Thanks for your help in advance.</p>
  
  <pre><code>//Gets author info to display on page and for use in query
  &lt;?php
      $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
  ?&gt;
  
  //Queries by category and author and starts the loop
  &lt;?php
      query_posts('category_name=blog&amp;author=$curauth-&gt;ID;'); 
      if ( have_posts() ) : while ( have_posts() ) : the_post();
  ?&gt;
  
      //HTML for each post
  
  &lt;?php endwhile; else: ?&gt;
      &lt;?php echo "&lt;p&gt;". $curauth-&gt;display_name ."hasn't written any articles yet.&lt;/p&gt;"; ?&gt;
  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>============ ALSO TRIED ============</p>
  
  <pre><code>&lt;?php
      new WP_Query( array( 'category_name' =&gt; 'blog', 'author' =&gt; $curauth-&gt;ID ) );
  ?&gt;
  </code></pre>
  
  <p>This doesn't work either, however it does filter the posts by author, just not by category! What am I doing wrong?</p>
  
  <p>Thanks!</p>