I’ve got a wordpress page which has a map of a recent trip I did.
http://www.marksmayo.com/south-american-journey/
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.
The same code is on:
http://www.marksmayo.com/northern-europe-and-asia-mission/
and is currently working, but as I add more posts that’ll presumably stop too.
The code is:
<?php
// The Query
query_posts( array ( 'category_name' => 'south america 2010', 'posts_per_page' => -1 ) );
// The Loop
while ( have_posts() ) : the_post();
echo '<li><a href=';
the_permalink();
echo'>';
the_title();
echo '</a></li>';
endwhile;
// Reset Query
wp_reset_query();
?>
Two things: use a simpler query and raise WP’s memory allocation.
Try this query, which resets itself and can be used any number of times on a page (with php execution) or in a page template. Change the name of the category and showposts to a number, or -1 to show all.
Raise WP’s memory allocation in wp-config.php with this near the top:
and check the php.ini file in your account to see if php memory is set to a very low limit. You’re on Bluehost, so if you don’t have a php.ini file, you can add a single php.ini in php configuration in Cpanel and then edit it in your root account.
Bluehost will allow that much RAM for php, but be aware that Bluehost will throttle your account CPU sometimes; check Cpanel for your CPU usage and throttling amounts.