[wp-hackers] Load page instead of including it

NewKind newkind at gmail.com
Fri Sep 2 11:04:33 UTC 2011


Yes, it's like a 404 page, but it would be displayed only when user will try to load the page with unsupported browser.
Thanks, for the hint - i'll take a look at the rewrite rules.

Thanks!

On 2 wrz 2011, at 12:33, Dion Hulse (dd32) wrote:

> Unfortunately that doesn't help me understand it at all.. "unsupported page"
> sounds like a 404 to me?
> Failing that, my 2nd suggestion seems to be what you want:
> 
>> The next option is to use a custom query var, and/or a a WordPress rewrite
>> rule, ie. catch $_GET['my-query=var'] on template_redirect, and load your
>> page directly (ie. don't run get_header()/get_footer() in the template
> file
>> you include).
> 
> On 2 September 2011 20:29, NewKind <newkind at gmail.com> wrote:
> 
>> Well it's just a landing page that would be displayed when user is using an
>> unsupported page.
>> There are no loops or any particular content besides the hardcoded one, but
>> what I'd like to have
>> on that page is the support for plugins to load theirs stuff, and wp header
>> with wp footer.
>> 
>> So it's a page with hardcoded html code + content, but dynamically
>> generated headers.
>> 
>> The way from integrating external pages with wp would be ideal but just
>> like I said, there are issues
>> with including the wp-blog-header.php file on different environments. I
>> don't want to use pages + page
>> templates as this strictly depends on users content.
>> 
>> Thanks
>> 
>> On 2 wrz 2011, at 12:18, Dion Hulse (dd32) wrote:
>> 
>>> You're best NOT loading the theme file (or a plugin file for that matter)
>>> directly.
>>> The "standard" way is to just use a Page Template and assign that to a
>> page,
>>> The next option is to use a custom query var, and/or a a WordPress
>> rewrite
>>> rule, ie. catch $_GET['my-query=var'] on template_redirect, and load your
>>> page directly (ie. don't run get_header()/get_footer() in the template
>> file
>>> you include).
>>> 
>>> There's a few other options depending on what you're actually doing.. For
>>> example, Custom RSS feeds can be defined, as well as using admin-ajax.php
>>> (it has logged in, and not-logged in actions).
>>> 
>>> Maybe you could give some details and someone can suggest the best
>> method?
>>> 
>>> On 2 September 2011 20:13, NewKind <newkind at gmail.com> wrote:
>>> 
>>>> Hi,
>>>> 
>>>> I was wondering if theres something like load_template that would
>> replace
>>>> the whole content instead of just including the provided file.
>>>> 
>>>> I'm trying to redirect user (on a certain conditions) to a custom php
>> file
>>>> located in the theme directory. The issue is that to do that the WP way,
>>>> i need to use require_once and point it from the theme directory to the
>> wp
>>>> directory. The require_once('../../../wp-blog-header.php'); doesn't
>> work,
>>>> and since WP isn't initialized - I don't have access to such constants
>> like
>>>> ABSPATH.
>>>> 
>>>> Maybe one of you knows a better way to do this …
>>>> 
>>>> Thanks!
>>>> _______________________________________________
>>>> wp-hackers mailing list
>>>> wp-hackers at lists.automattic.com
>>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>>> 
>>> _______________________________________________
>>> wp-hackers mailing list
>>> wp-hackers at lists.automattic.com
>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>> 
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>> 
> _______________________________________________
> 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