• Hello every one, I am a WordPress Develper, and I have worked in 17 languages. I am working on this website that requires that each language will be able to display a series of Postings from its anual series of studies, see: http://www.melechyisrael.ca/torah-english/

    Hre is the the code I use to fetch each category:

    [code]

      <?php global $post; $myposts = get_posts('numberposts=20&offset=0&category=6998'); foreach($myposts as $post) :?>
      <li class="arch-th">"><?php the_title(); ?>
      <?php endforeach; ?>

    [/code]

    There is 60 different categories. But they kill the site (they use more then 32 megs of ram every time they are accessed. Any ideas on how to reduce the server’s load.

    This is the only way I thought I could show all categories from that section. Any ideas? any pointers?

    Thanks,

Viewing 5 replies - 1 through 5 (of 5 total)
  • First thing that springs to mind is that your code looks slightly wrong –

    <li class="arch-th">"><?php the_title(); ?>
    should surely be
    <li class="arch-th"><?php the_title(); ?></li>

    Not an expert on memory leakage by any means, but I’d suspect that is not helping as it would be nesting the List Item 20 times rather than listing 20 seperate items.

    Give that a try and let us know if things improve at all.

    Thread Starter Messianic Web Developer

    (@messianicwebmaster)

    Thanks Duck Boy. How would I list all the posts in any category without mentioning the #?

    Thread Starter Messianic Web Developer

    (@messianicwebmaster)

    Actually Duck boy, that “> is needed there. I figure out insted of saying I want upto 20 posts to show up. I just put -1, and it shows every post in that category. Thanks,

    But now I am wondering how to speed up the System.

    How many posts is it picking up? I have about 600 showing in one of my categories and it doesn’t really slow anything down as they are paged (I have 10 on a page).

    Don’t know who your host is, but mine has tools that I can use on the control panel to allow me to monitor the server that my site is hosted on – CPU usage, Memory usage, temperature, HDD free space, Network usage, etc. May be worth seeing if you can do that, as it might not be anything you are doing, could be the server you are hosted on.

    Thread Starter Messianic Web Developer

    (@messianicwebmaster)

    thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Query_posts Killing my website (memory killer)’ is closed to new replies.