[wp-hackers] Any way to bypass $wp->query_posts()?

Otto otto at ottodestruct.com
Thu Apr 9 17:17:21 GMT 2009

On Thu, Apr 9, 2009 at 12:10 PM, Dougal Campbell <dougal at gunters.org> wrote:
> The main argument against using a plugin that modifies .htaccess is that is
> not always cross-web-server compatible (e.g. when running under IIS). There
> *are* plugins that modify .htaccess, however (cf, wp-super-cache). It
> wouldn't be my first choice, though. I'd prefer to do these sorts of things
> inside the WordPress framework whenever possible. And yes, WP Super Cache is
> a bit of an exception, because the point of it is to bypass WordPress and
> push caching off onto the http server.

If the .htaccess rules don't work, then non-default permalinks don't
work either. Sure, there's workarounds for IIS and such, but those
require a higher level of work anyway, to make this sort of thing work
at all.

>> If you're not loading anything from the posts table, then why load any
>> part of WordPress at all? There's nothing in WordPress that you need
>> if you're not loading something from the posts table as well.
> I'm afraid there is: a links page (cf, themes/default/links.php). Well, and
> the 404 page (but maybe that one isn't really fair to throw in here ;) )

Sorry, but the default/links.php is a Page Template. If you don't load
the Page from the posts table, then WordPress has no way to know what
Page Template it has to use for the given Page.

The 404 I give you, but that's cheating. Anyway, until you run the
query and get no results, you don't know if a 404 page is required.

> A couple of other non-standard examples I could think of would be: a page
> that listed authors (or even an author profile page), or a 'lifestream' page
> that pulled content from other services.

All "Pages" are in the posts table.

> I think the ability to bypass making an actual query, while still allowing
> content to be generated within the existing theme system is pretty valid.

I don't, as without the query, you have no way to know what template
file is actually needed to be loaded in the first place.


More information about the wp-hackers mailing list