WPtouch Mobile Plugin
[resolved] A way to force mobile mode (2 posts)

  1. Josh Levinson
    Posted 3 years ago #

    The only way thus far I have been able to force WPTouch into mobile mode dependant upon a url is with the following code I whipped up:

    function empty_wp_touch_agents($device_list){
    	return array();
    function url_wp_touch(){
    	$url = $_SERVER['REQUEST_URI'];
    	$url = parse_url($url,PHP_URL_PATH);
    	$url = explode('/',$url);
    		$touch = new WPtouchProThree();
    		$touch->active_device = 'default';
    		$touch->active_device_class = 'default';

    Yes, I have the pro version. Not sure if this would work for the free version. My goal in posting here is to raise awareness and prove that it is definitely possible to do this, and there IS a need for it. Obviously what sucks is that this code is subject to the whims of WPTouch changing their class and/or function names.

    BraveNewCode - please make this a filter or something so that developers can force mobile mode if they want to, bypassing all requirements of user agents, etc.

    Again, there IS a good scenario for this, like when a portion of a site is going to be only accessed through a mobile app's built-in browser (pass-through). I have seen multiple requests for this and I kindly ask that you add some solution better than mine into your plugin.

    See: http://wordpress.org/support/topic/plugin-wptouch-call-mobile-version-with-direct-url


  2. BraveNewCode Inc.
    Plugin Author

    Posted 3 years ago #


    We'll continue this conversation in the ticket(s) you have opened in our WPtouch Pro support center.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WPtouch Mobile Plugin
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic