New wp_query the most efficient way concerning database calls?
-
I need to show a lot of information in the sidebars and footers of my wordpress installation. It seems that each new wp_query adds at least 5 database calls, which seems a lot. Is it really the most efficient way of querying additional posts (outside of the main loop), or is there a better way?
Can someone validate that this is the way it should be done?
Here is an example, which seems to add 5 database queries:
<?php $my532_query = new WP_Query('category_name=CATNAME&showposts=5'); ?> <?php while ($my532_query->have_posts()) : $my532_query->the_post(); ?> <?php the_title(); ?> <?php the_excerpt(); ?> <?php endwhile; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘New wp_query the most efficient way concerning database calls?’ is closed to new replies.