Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there a Wordpress plugin out there, that redirects only Blackberry visitors to a very simple basic something of the site?

Currently I have a responsive website, a long vertical one with smoothscroll.js (Similar to the Nike one). It responds in iOS, Android, and iPad - and while it displays alright in BB (curve 2009), its very hard to read text. I have to support curve 2009 + BB.

Any suggestions?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

There isn't one that I know off, however if you wanted to write a script to solve your problem then:

In Javascript:

<script type="text/javascript">   
   var userBrowser = navigator.userAgent;
   var url = "http://forblackberryusers.yoursite.com/";
   if (userBrowser.indexOf("BlackBerry") >= 0)
   {
      if (userBrowser.indexOf("WebKit") >= 0)
      {
         window.location = url;
      }
   }
</script>

or alternatively you could be smart and try and create a plugin. In php, I'd imagine it would have something along the lines of:

<?php
   $userBrowser = strtolower($_SERVER['HTTP_USER_AGENT']);
   $blackberry = strrpos($userBrowser, "blackberry");
   $webkit = strrpos($userBrowser, "webkit");
   $url = "http://forblackberryusers.yoursite.com/";

   if (!($pos_blackberry === false))
   {
      if (!($pos_webkit === false))
      {
         header("Location: " . $url);
      }
   }
?>

Hope that helps

share|improve this answer
    
This seems like a good suggestion, I'll give it a go - thanks! –  Frank Milo Feb 15 '12 at 14:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.