Search code examples
phpiphonewordpressmobilemobile-safari

Remove iPhone detection on Wordpress login page


I have wordpress a site with a customized login page, the problem is when I go to that page on my iPhone, it detects it as an iPhone and adds the viewport meta tag, which normally would be great but this particular login page I want to be viewed full sized and zoomable, not iPhone sized and non-zoomable. So I need to remove the iPhone detection from the login page without modifying the wordpress core. Anybody have any ideas?


Solution

  • Found a solution. Add this to the functions file:

    function remove_iphone_detection() {
        global $is_iphone;
        $is_iphone = false;
    }
    
    add_action('init', 'remove_iphone_detection');
    

    Though this removes iphone detection from wordpress a a whole, not just the login page, it achieved what I needed.