title: wordpress php query by category name
body: <p>I was wondering to do separate blog pages for separate category posts. What I was able to find was running query by category number, but this is not dynamic enough for me as I would like to run query on page title which is = category name. </p>
  
  <p>Basically on page "events" I would like to display blog posts that are under category named "events"(category name == page title), and so on.</p>
  
  <p>Any insights on how to achieve this would be great. What I tried to do and failed, was: </p>
  
  <pre><code>&lt;?php query_posts('category_name='.get_the_title()); ?&gt;
  &lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;
      &lt;div&gt;
          &lt;h1&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;
          &lt;p&gt;&lt;?php the_content(); ?&gt;&lt;/p&gt;
      &lt;/div&gt;
  &lt;?php endwhile; else: ?&gt;no match&lt;?php endif; ?&gt;
  </code></pre>
  
  <p>Thanks in forward for any insights, links or notices.</p>