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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hot to recognize that your site is viewed on mobile device.

    I have a site for mij store www.degoudwaag.nl. I am using WordPress and I now want to go mobile with my site. My first question is (and sorry if it has been asked before, haven't found it): how can you get Wordpress to recognize that my site is viewed on a mobile device and how to redirect to i.e. an "m.address.com" address in that case?

    Many thanks!
    Last edited by WA; 07-16-2012 at 11:20 PM.

  • #2
    New to the CF scene
    Join Date
    Jul 2012
    Location
    Sweden / Sverige
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you download this file and put it into your site and then put this into your index.php file:

    It needs to end with .php or else the script won't work
    PHP Code:
    require_once 'Mobile_Detect.php';
    $detect = new Mobile_Detect();
    if(
    $detect->isMobile() or $detect->isTablet()){
    header("Location: http://m.yoursite.com/");

    The script is not hard or complicated, if you reed it you would probably understand it clearly.

    This will redirect any mobiles or tablets to your mobile version of your site.

    More info on how you can use the Mobile_Detect.php file can be found here.

    Important notes:
    The file needs to be unzipped, and the content is going into your server.
    The demo.php file is not necessary, only the Mobile_Detect.php file.
    The Mobile_Detect.php file needs to be in the same directory as the file you put the script into.

  • #3
    Regular Coder
    Join Date
    Jun 2011
    Location
    CA
    Posts
    105
    Thanks
    0
    Thanked 10 Times in 10 Posts
    Wordpress has several plugins that provide this functionality. Here is one of them:
    http://wordpress.org/extend/plugins/wptouch/

  • #4
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your replies guys! Eventually I decided to go with dudamobile.com. It costs a few bucks a year but is easy to implement and yield beautiful results. I am now considering doing that for my other website as well.
    Last edited by VIPStephan; 03-13-2013 at 03:12 PM. Reason: removed links


  •  

    Posting Permissions

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