WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. strikernr
    Member
    Posted 1 year 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

    http://wordpress.org/plugins/wp-mobile-detect/

  2. strikernr
    Member
    Posted 1 year 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
    Member
    Posted 1 year ago #

    double post

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.