简体   繁体   中英

if is phonegap load different theme at wordpress

i want to know how can I load a different theme in my wordpress website when the access is made by a phonegap app.

So, i created a phonegap html page with a link to my wordpress theme, I want when to click at that link the wordpress load a different theme.

Have the PhoneGap app initially append ?theme=[MY THEME] to the end of the URL.

Then, on the WordPress side, the first page will work (as you said), but if the user then clicks another link, it no longer contains the ?theme=[MY THEME] , so it loads a standard page.

So, on the WordPress side, implement the following logic:

if (theme && (theme == [MY THEME])) {
  //append the "?theme=[MY THEME]" string to the end of all the internal URL's on this page
}

You should use & instead of ? if the link already has get-parameters , but anyways, best of luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM