[wp-hackers] Template Redirection

Ryan Boren ryan at boren.nu
Wed Aug 25 03:24:00 UTC 2004


On Tue, 2004-08-24 at 22:21 -0400, Carthik Sharma wrote:
> I guess it can be wholesale disabled by editing index.php ;)
> Not a very smart solution, but it will work for sure.

Well, we could add something like $wp_no_redirection, which if set
before including wp-blog-header would turn off the redirection checks
for you calorie counters out there.  However, my brief profiling showed
no performance hit.  What I'll probably add is an is_home() check at the
top.  Since loading the home page is the most common case, we'll check
it first and then no-op.

if (is_home()) {
  // Do nothing, just fall through.
} else if (...) {
...
}

When loading the front page, the added cost would merely be the call to
is_home().

Ryan


> On Tue, 24 Aug 2004 22:06:22 -0400, David Chait <davebytes at comcast.net> wrote:
> > Cool feature, though a bit 'wasteful' on processing -- just a teensy bit,
> > but still...  It should really be a feature that can be wholesale
> > disabled/enabled at the least.  IMHO.
> > 
> > d
> > 
> > ----- Original Message -----
> > From: "Ryan Boren" <ryan at boren.nu>
> > To: "WordPress Hackers" <hackers at wordpress.org>
> > Sent: Tuesday, August 24, 2004 1:07 PM
> > Subject: [wp-hackers] Template Redirection
> > 
> > > In CVS is some experimental code which can load different templates for
> > > different query types, all from index.php.  For example, if the query is
> > > for a category, we check to see if wp-content/category.php exists.  If
> > > so, we use it instead of index.php.  The same is true of authors, single
> > > posts, dates, archives, and so forth.  If you do not provide alternative
> > > templates in wp-content, index.php behaves the same way it ever has.
> > > ...
> > 
> > 
> > 
> > 
> > _______________________________________________
> > hackers mailing list
> > hackers at wordpress.org
> > http://wordpress.org/mailman/listinfo/hackers_wordpress.org
> > 
> 
> 




More information about the hackers mailing list