Support » Plugins » Hacks » Redirecting mobile users to another theme

  • Hi everyone,
    I want to make my theme redirecting mobile visitors to another theme. I found a lot of tutorials either using a bunch of plugins (which I don’t want to) or telling me, that you cannot redirect outside of a plugin. I found this way to change the stylesheet and template directory but not to change the folder of the themes:

    add_filter('template', array(&$this, 'switch_theme'));
    add_filter('option_template', array(&$this, 'switch_theme'));
    add_filter('option_stylesheet', array(&$this, 'switch_theme'));
    function switch_theme()
    global $device;
    return $device;

    Using this in my themes functions.php it changes the stylesheet directories but not the directory for the files like head.php or index.php to the other folder. Where am I wrong? Any help would be appreciated!!!

    Thanx in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Anders


    So you’re trying to use a completely different theme?



    No, I try to redirect mobile users to a child theme of my theme framework…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirecting mobile users to another theme’ is closed to new replies.