views:

54

answers:

2

I'm writing a wordpress newspaper theme. Because the theme makes use of multiple loops, it generates a lot of queries. Plus, I have to make many options dynamic because the theme will be released to the public (so I can't hardcode a lot of stuff).

On the front page, with a typical setup (a top story area, five newsboxes [that's five wordpress loops], a main menu, a secondary menu and a footer menu plus six sidebars) and NO plugins, the total query count is 154. I'm not sure if I'm allowed to post a link, but here is the page: http://pixelplanethemes.com/citizenpress/demo/

How is the loading time for you? The query count for me is 154 in 0.543 seconds (you can see the query count in the footer). Sometimes the count is higher, but after I refresh it the number goes down to this.

I know this number is very high, but I have no idea how to reduce it because my programming skills are not very high. I've seen huge forums which have only 14 queries. My main question is, do you think this number is too high? Thanks for any advice.

I'm using WP_Query object to handle the multiple query loops. Is there a way to cache it without needing to use a plugin?

A: 

You have several other noticeable issues, including resizing pictures in HTML, instead of using thumbnail versions.

Load time for me (no cache, full load) is 9.89 seconds. That's dead slow.

Do I think 154 queries to render a front page is bad? Yes. WP is a pig but it's not that much of a pig.

Josh K
Well, do you have any ideas on how I can reduce it? Caching strategies? Are you talking about images on the front page when it comes to resizing pictures? Also, why does it take 9.89 seconds to load for you...it never takes more than 1 second for me...is it my connection?
orbit82
A: 

I know this isn't exactly what you're looking for, but one of the easier ways to create fewer queries is to compile scripts instead of running queries for each individual data set. You probably don't have 100 tables, most likely only 20 or so. So what you would do is create a set of requests for data and then pull that data all at once through a single query instead of multiple queries before the page load.

Depending on your web host and bandwidth, that load time isn't too bad.

EDIT: However you have numerous other HTML issues as the other poster stated that are causing much larger lag times.

Organiccat
Thanks for the info. Do you have any idea about how I would create this set of requests as you suggest? And how I would call them throughout the site?
orbit82