WordPress.org

Forums

Adding exceptions for individual pages (2 posts)

  1. chrisbaily
    Member
    Posted 3 years ago #

    I'm trying to install WP Mobile Detector on my site but I have an odd problem - I'm using my wordpress database to also service a mobile app we're developing. We have an API and custom API page in my main theme on my site that is called by the app, but when I install WP Mobile Detector, the app can't talk to my site. I'm assuming this is because MD is detecting the API call as mobile and switching to the mobile theme. Is there a way to specify a URL and have that page only not switch to a mobile theme? Thanks for the plugin!

  2. websitezcom
    Member
    Posted 3 years ago #

    You'd either have to write your own plugin or modify this plugin's detection to return false on the pages you do not wish to have mobile activated on.

    Modifying the plugin would be the easiest.

    In the functions.php file, there is a function called: websitez_detect_mobile_device()

    You can modify this function and add code like this:

    if(is_page('mobile_app')):
    //code here etc
    endif;

Topic Closed

This topic has been closed to new replies.

About this Topic