Have you run any site optimization tools? that is a lot of queries, but not unheard of…
Also, you can reduce that by not loading say, 187 posts on a page – are you paginating the posts?
site link?
i design my theme by myself. not use any outside plugin.
i code:
$query = new WP_Query(array('posts_per_page' => 10, 'category_name' => 'tin-tuc'));
....
wp_reset_postdata();
$query = new WP_Query(array('posts_per_page' => 10, 'category_name' => 'tai-lieu'));
....
wp_reset_postdata();
and a lot of alike snippets. i get all of them out and then put into one by one. i found out every snippet need 5 query to database.
site link: http://www.dientudangkhoa.com/
thanks.
Do this:
Add this to the footer, just above </body>:
<div><?php echo get_num_queries() ?> queries in <?php echo timer_stop(0) ?> seconds</div>
This will give you the # of queries on each page (with footer, of course) and how long in seconds to make them…
If on a shared host, this can vary (the time)…report back so we can see..
it put in the footer tag. you can see at the Menu section in footer
i think validator.w3.ord website can only check html error. not related to query to database. if it have error with html, it will not affect to php and mySQL.
You should try to make a query and follow that with get_categories…once you have pulled the posts, run the functions but only when needed (per page template in use)
http://codex.wordpress.org/The_Loop#Multiple_Loops_Example_2