[wp-hackers] by passing the entire template hierarchy

Haluk Karamete halukkaramete at gmail.com
Tue Jul 8 01:59:37 UTC 2014


Thank you Shane for your comment..

There currently is no way in WordPress that I know of to prevent the
behaviour I described.

Wordpress has to do its chores and check those files one by one - following
the template hierarchy  - no matter what the case be.
Neither the template_redirect , nor the template_include would prevent that
from happening.

I was strictly approaching the matter from a performance point of view as
you've correctly sensed.

But sometime during the afternoon today, I just let go of that. :)

It's OK for the template hierarchy  to take its course - checking all those
files even thought, in my case 100% of the time, index.php will prevail at
the end of those look ups. Since the PHP's "file_exists" function is
failrly fast, there is no need for me to worry about that.

I'm just moving on...





On Mon, Jul 7, 2014 at 6:46 PM, Shane Thompson <
prog.support at webwizards.com.au> wrote:

> Hi Haluk,
>
> Although it is possible, as already described, I don't think it would be a
> very good idea to circumvent this. If you must, template_include is
> probably better for this than template_redirect, as template_redirect (my
> understanding) is purely for doing redirects. ie. I want /courses/ to
> redirect to /courses/medical so I would do this with template_redirect.
>
> If you are trying to circumvent it for performance reasons, you're not
> making much of a performance benefit at all. We can discuss ways to get the
> best performance out of WP here, if that is what you are after.
>
> Shane Thompson
>
> >> On 7 July 2014 10:34, Haluk Karamete <halukkaramete at gmail.com> wrote:
> >> > Is there a way to by pass the great system known as the  WordPress
> >> Template
> >> > Hierarchy so that WordPress shoots the ball straight to the last
> resort
> >> > which is index.php?
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list