Detecting Mobile Devices Accessing Your WordPress Site

Mobile web surfing is continuing to evolve on a larger scale. This is why detecting those users who are visiting your WordPress blog through a mobile device and redirecting them to a mobile version of your site is important. In order to achieve this, you first have to get the code from and upload it to your theme directory.

[ad name=”Adsense – text only”]

Then, all you simply have to do is open your header.php file and place the following at the top of the file. Remember to edit line 4 to where you’d like to redirect mobile users.

The Source:

$mobile = mobile_device_detect();
if ($mobile){

Leave a comment

Your email address will not be published.