WP Mobile Detect
wpmd_is_windows_mobile() NOT working! (3 posts)

  1. strikernr
    Posted 2 years ago #

    I'm testing this function in windows phone and it is returning false. I'm using this function to display a particular ad (ad1 below) for windows user, however, it always get ad2 in windows mobiles (Testing it on Windows mobile 7.5 on Nokia Lumina 710).

    <?php if (wpmd_is_windows_mobile()): ?>
     show ad1
    <?php else: ?>
     show ad2


  2. strikernr
    Posted 2 years ago #

    I have resolved this.

    Just add the following code to wp-mobile-detect.php

    function wpmd_is_windows_phone() {
    	global $detect;
    	if( $detect->isWindowsPhoneOS() ) return true;

    You can now call the function wpmd_is_windows_phone in your theme to detect smart phones running windows.

    Be sure to also update the core class mobile-detect.php to the latest version from the mobiledetect.net

  3. strikernr
    Posted 2 years ago #

    double post

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Mobile Detect
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.