[wp-hackers] Where to insert mobile redirect code?
aaron at jorb.in
Tue Mar 27 22:03:59 UTC 2012
I would look at doing it as a MU plugin -
On Tue, Mar 27, 2012 at 6:01 PM, Mike Schleif <wordpress at helices.org> wrote:
> I have this simple PHP code:|
> require_once "/_PATH_/_DOMAIN_/class.**mobile.php";
> $mobile = new MobileWebarto("http://m._**DOMAIN_");
> Obviously, _PATH_ and _DOMAIN_ are placeholders.
> class.mobile.php identifies whether or not the visitor is a mobile device.
> On most sites, inserting this code at line #1 of header.php behaves
> exactly as I want and expect.
> However, some sites do NOT behave as desired.
> In reality, I want this code to execute PRIOR to any theme code.
> Furthermore, I don't want WordPress updates to remove the call to this
> It seems that this code could be inserted into index.php - BUT ...
> HOW can this be done WITHOUT future WP updates removing my code?
> Please, advise. Thank you.
> wp-hackers mailing list
> wp-hackers at lists.automattic.**com <wp-hackers at lists.automattic.com>
More information about the wp-hackers