I want to setup an Android and iOS App that calls my WP site via WebView. Somehow, i wasn't able to find the best way to do this via Google. First I was thinking about putting some Code in my functions.php that detects if I am a WebView App Visitor and then deliver another Theme. Then I thought about using the Multisite Function for this, but i believe this is not a good Idea since I am not really using two "different" Websites, for which this Function is, I just need different themes delivered.
So, what would the best Practice for this? Detect if the user is surfing with WebView and then change the Theme (which WP Function can do that?).
Note: I am trying to not use any Theme-Switcher Plugins for this since I want to keep the Plugin Bloat as small as possible.
Thanks!
UPDATE: Since I think my Question was not well written... The Website already is responsive for mobile users that visit the site with their regular mobile phone browser. My Goal is to to deliver a completely different theme for People that use a App that I am going to develop, since the App is going to work different than the regular website but still needs to grab the WP Posts - WebView App detection will be made via User Agent or similar.
I want to setup an Android and iOS App that calls my WP site via WebView. Somehow, i wasn't able to find the best way to do this via Google. First I was thinking about putting some Code in my functions.php that detects if I am a WebView App Visitor and then deliver another Theme. Then I thought about using the Multisite Function for this, but i believe this is not a good Idea since I am not really using two "different" Websites, for which this Function is, I just need different themes delivered.
So, what would the best Practice for this? Detect if the user is surfing with WebView and then change the Theme (which WP Function can do that?).
Note: I am trying to not use any Theme-Switcher Plugins for this since I want to keep the Plugin Bloat as small as possible.
Thanks!
UPDATE: Since I think my Question was not well written... The Website already is responsive for mobile users that visit the site with their regular mobile phone browser. My Goal is to to deliver a completely different theme for People that use a App that I am going to develop, since the App is going to work different than the regular website but still needs to grab the WP Posts - WebView App detection will be made via User Agent or similar.
Share Improve this question edited Nov 17, 2015 at 15:43 pukka asked Nov 16, 2015 at 14:20 pukkapukka 33 bronze badges2 Answers
Reset to default 0hmm this is called responsive web design. Being responsive doesn't mean the UI has to be 100% the same.
Have your JS detect that you are in webview, maybe via user agent, and then set some appropriate class on the body element. design your webview design around that class.
My Solution now was:
1) Made my App send Custom HTTP Headers 2) Coded myself a WP Plugin that searches for these Headers with every called URL and then deliver another theme with two simple WP Filters.
With this Solution I did not had to use the Multisite feature, no Subdomain, no SEO Problems (so Far!), and of course no 10k$ App needed to make it look very nice!
I hope this is a little help for anybody who is searching for this.