title: Wordpress category php query running out of memory?
body: <p>I've got a wordpress page which has a map of a recent trip I did.</p>
  
  <p><a href="http://www.marksmayo.com/south-american-journey/" rel="nofollow">http://www.marksmayo.com/south-american-journey/</a></p>
  
  <p>If I then write a basic php query function to list all posts in the category 'south america 2010', it works fine for 4-5 posts, but as I added posts to the category, it started running out of memory with this query (giving errors on the page), and now just doesn't load anything below the map.</p>
  
  <p>The same code is on:</p>
  
  <p><a href="http://www.marksmayo.com/northern-europe-and-asia-mission/" rel="nofollow">http://www.marksmayo.com/northern-europe-and-asia-mission/</a></p>
  
  <p>and is currently working, but as I add more posts that'll presumably stop too.</p>
  
  <p>The code is:</p>
  
  <pre><code>&lt;?php
  
  // The Query
  query_posts( array ( 'category_name' =&gt; 'south america 2010', 'posts_per_page' =&gt; -1 ) );
  // The Loop
  while ( have_posts() ) : the_post();
      echo '&lt;li&gt;&lt;a href=';
          the_permalink();
          echo'&gt;';
      the_title();
  
      echo '&lt;/a&gt;&lt;/li&gt;';
  endwhile;
  
  // Reset Query
  wp_reset_query();
  
  ?&gt;
  </code></pre>