WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Auto switch to mobile theme (5 posts)

  1. Beatboxx
    Member
    Posted 1 year ago #

    Hi,
    I have a wordpress website, and I want my mobile visitors to view a different version of the website than my desktop visitors. I made two themes, one that I want to show to my desktop visitors and one that I want to show to my mobile visitors. I have tried to do this with the switch_theme(); function, but that function just changes the theme until you change it, not for just that visit. I also want to be able to add pages with custom templates to both of them, and I want to be able to change their sidebars. Can anyone tell me how to do this?

  2. Andrew Bartel
    Member
    Posted 1 year ago #

    I believe you'd need to set up a subdomain, ex. m.mysite.com instead of mysite.com and use a separate WordPress installation, although you get reference the same database.

  3. Beatboxx
    Member
    Posted 1 year ago #

    Isn't there a better option? Is this option not a seo-killer?

  4. Beatboxx
    Member
    Posted 1 year ago #

    Your idea doesn't work for me I guess. I have set up two wordpress themes, one on m.mydomain.com and the main on mydomain.com. If I go to m.mydomain.com, the mobile theme does show up, but then if I click a link, I directly get redirected to the main site again. Anyone?

  5. Beatboxx
    Member
    Posted 1 year ago #

    It works! I have used this blog post: http://www.blogtips.org/how-to-enable-mobile-theme-on-wordpress-blog/

    In short, install the plugin "WP Mobile detector"

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.