title: Looping through wordpress categories
body: <p>I am new to Wordpress and been pulling my hair out trying to create a category loop.  The loop is supposed to:</p>
  
  <ol>
  <li>loop through all categories</li>
  <li>echo out the category name (with link to  </li>
  <li>echo out the last 5 posts in that category (with permalink to post)</li>
  </ol>
  
  <p>The html for each would be </p>
  
  <pre><code>&lt;div class="cat_wrap"&gt;
     &lt;div class="cat_name"&gt;
         &lt;a href="&lt;?php get_category_link( $category_id ); ?&gt;"&gt;Cat Name&lt;/a&gt;
     &lt;/div&gt;
     &lt;ul class="cat_items"&gt;
        &lt;li class="cat_item"&gt;
           &lt;a href="permalink"&gt;cat item 1&lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="cat_item"&gt;
           &lt;a href="permalink"&gt;cat item 2&lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="cat_item"&gt;
            &lt;a href="permalink"&gt;cat item 3&lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="cat_item"&gt;
           &lt;a href="permalink"&gt;cat item 4&lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="cat_item"&gt;
           &lt;a href="permalink"&gt;cat item 5&lt;/a&gt;
        &lt;/li&gt;
     &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Please help </p>