title: How to get category name from URL and pass to a template
body: <p>I'm using the following page template to display the posts in a single category and plan to format the first post differently than the others. This works as desired but I have the category_name hard coded in the template. I want to use this template for several different categories and would like to learn how to pass the category_name to the template from a link.</p>
  
  <p>For example, the link to the desired page using the special template is <a href="http://wildcatweb.net/5th/" rel="nofollow">http://wildcatweb.net/5th/</a> and '5th' is also the category_name. How do I tell the template to get the category_name from the URL and use it in the template?</p>
  
  <pre><code>&lt;?php
  /*
  Template Name: pageAssignments
  */ ?&gt;
  
  &lt;?php get_header(); ?&gt;
  
  &lt;div class="small-12 large-8 columns" id="content" role="main"&gt;
  &lt;header&gt;
                  &lt;h1 class="entry-title"&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;
  
          &lt;/header&gt;
  
    &lt;!-- show latest post FULL --&gt;
  
   &lt;?php query_posts('showposts=1&amp;category_name=5th'); ?&gt;
  
      &lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;
  
      &lt;div class="lastest-post"&gt;
  
  
  
       &lt;h2 class="pagetitle"&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;
  
                          &lt;?php the_content(); ?&gt;
  
  &lt;/div&gt;&lt;!--close .latest-post --&gt;
  
   &lt;?php endwhile; endif; ?&gt;&lt;!-- end lastest post --&gt;
  
   &lt;!-- show older post excerpts --&gt;
  
  &lt;?php query_posts('showposts=5&amp;offset=1&amp;category_name=5th'); ?&gt;
  &lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;
      &lt;div class="older-post"&gt;
  
           &lt;h3 class="pagetitle"&gt;&lt;a href="&lt;?php the_permalink() ?&gt;"     rel="bookmark" title="&lt;?php the_title(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;
          &lt;?php the_excerpt(); ?&gt;
  
      &lt;/div&gt;&lt;!--.older-post --&gt;
  
  &lt;?php endwhile; endif; ?&gt;&lt;!-- end past-entry --&gt;
  
  &lt;/div&gt;
  
  &lt;?php get_sidebar(); ?&gt;
  
  &lt;?php get_footer(); ?&gt;
  </code></pre>