Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    What's the best way to redirect a single page for mobile devices?

    Hi all,

    I have been doing a lot of research on how to redirect a single page from my WordPress website to a mobile version (I would like to redirect all mobile users who visit http://lifebyjohn.com/schedule to http://lifebyjohn.com/mobile-schedule, I do not want to redirect all mobile users for all my pages to a different page or theme, only just a single page).

    However, I have yet to find a plugin that can do this. I've seen a few "scripts" around the internet, most notably WURFL or http://www.detectmobilebrowsers.com, but I don't know the code to enter into my "head" in order to redirect the page correctly.

    In any event, I'm just looking for an easy way to get a mobile device redirect going for my single page, hopefully through a method that continually "updates" itself like http://www.detectmobilebrowsers.com or WURFL.

    Any help would be most appreciated!

    - John

  • #2
    New to the CF scene
    Join Date
    May 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi all,

    As a follow up to my post above, I have done some research online and come across some PHP code that can distinguish between different pages on a Wordpress website, such as:

    <?php if (is_page(1111)) {.......}; ?>

    What I'm thinking of doing is putting some kind of mobile redirection script in there, so that I achieve my goal of only needing the mobile redirection to happen for one page on my website.

    However, I have attempted to put the code (both PHP and Javascript) downloaded from www.detectmobilebrowsers.com into that PHP code, and have tried putting it in both header.php and page.php to no avail (in fact, it crashes my site in most cases, or just doesn't work). Am I going about this wrong? Am I using the wrong code? Do I need a plugin to help with that?

    Thanks so much to everyone who can help!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •