title: list wordpress posts from current category only
body: <p>I'm attempting to create a second nav menu on my wordpress site.</p>
  
  <p>I want this to show links to all posts within the current category only.</p>
  
  <p>I've been experimenting with the get_posts function but am struggling to find how to dynamically select the current category. i.e.  what to place in here <strong>category=x</strong></p>
  
  <p>Any help is greatly appreciated</p>
  
  <p>Here is my template code I have been using</p>
  
  <pre><code>&lt;ul id="catnav"&gt;
  
       &lt;?php
       global $post;
       $myposts = get_posts('numberposts=5&amp;category=1');
       foreach($myposts as $post) :
       ?&gt;
          &lt;li&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;
       &lt;?php endforeach; ?&gt;
  
  
  
      &lt;/ul&gt;
  </code></pre>