Title: [Plugin: Mobile Smart] Redirect doesn&#039;t load desktop css
Last modified: August 20, 2016

---

# [Plugin: Mobile Smart] Redirect doesn't load desktop css

 *  Resolved [davezatch](https://wordpress.org/support/users/davezatch/)
 * (@davezatch)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-mobile-smart-redirect-doesnt-load-desktop-css/)
 * The plugin is working well but when I load the desktop version from the mobile
   version, it doesn’t load the desktop css file, so everything is haywire until
   I refresh. Started fooling around with getting the referrer link with PHP but
   perhaps this is an issue you know a workaround for?
 * [http://wordpress.org/extend/plugins/mobile-smart/](http://wordpress.org/extend/plugins/mobile-smart/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [dolby_uk](https://wordpress.org/support/users/dolby_uk/)
 * (@dolby_uk)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-mobile-smart-redirect-doesnt-load-desktop-css/#post-2554097)
 * Hi Dave,
 * Sorry to hear you’re having problems. I’ve not seen this issue before – though
   this could be a cookie problem. You can test if this is true, by clicking on 
   a further page once you’re on the (non-styled) desktop version – does it return
   to the mobile site or stay on the desktop version (non-styled / styled)?
 * It might also be something to do with if you’re using a child theme – there have
   been reports of occasional problems with such themes, but nothing that I’ve been
   able to repeat yet.
 * Best regards,
 * Dan
 *  Thread Starter [davezatch](https://wordpress.org/support/users/davezatch/)
 * (@davezatch)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-mobile-smart-redirect-doesnt-load-desktop-css/#post-2554332)
 * Dolby_uk,
    You were right about the cookies. I’m also using jquery mobile which
   hijacks all my links. Had to add a rel=”external” on the switch to desktop link,
   now it works fine. Thanks for the great plugin!
 * Dave
 *  Plugin Author [dolby_uk](https://wordpress.org/support/users/dolby_uk/)
 * (@dolby_uk)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-mobile-smart-redirect-doesnt-load-desktop-css/#post-2554339)
 * Dave,
 * OK that’s good. So is it working now, or do you need support on the cookie issue?
 * Dan
 *  Thread Starter [davezatch](https://wordpress.org/support/users/davezatch/)
 * (@davezatch)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-mobile-smart-redirect-doesnt-load-desktop-css/#post-2554340)
 * Dan,
    It’s working now, marking as solved.
 * Thanks,
    Dave
 *  [jason_lane](https://wordpress.org/support/users/jason_lane/)
 * (@jason_lane)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-mobile-smart-redirect-doesnt-load-desktop-css/#post-2554487)
 * Dan,
 * I encountered what appears to be the same problem; on my sites (a dev site on
   my local machine, and a live site) the plugin wasn’t switching to the desktop
   version when the switcher link was clicked. I think I narrowed it down to 2 things:
 * 1. When the plugin sets a cookie to indicate the preference to view the desktop
   site, the cookie data wasn’t being set properly. I had a look in the plugin code,
   and I can see that the last parameter of the setcookie() function is trying to
   set the correct domain name for the cookie (on line 964 of mobile-smart.php).
   However, on my two sites, the domain that was being set was invalid, for 2 different
   reasons:
 * a) The plugin tries to strip ‘[http://www&#8217](http://www&#8217); from the 
   front of the blog’s home url, to leave a bare domain (eg. example.com). However,
   I usually use naked domains on my sites, so there’s no ‘www’ in the blog url,
   and therefor the plugin code doesn’t strip the ‘http’ part from the url (eg. 
   [http://example.com](http://example.com)). I don’t believe that’s a valid domain
   for a cookie.
 * b) My dev site uses a multisite WP install, with subfolders. So the blog url 
   would be something like ‘[http://example.com/blogname/&#8217](http://example.com/blogname/&#8217);
   AFAIK, the domain paramater for setcookie() must be just the domain part, without
   subfolders.
 * For me, the easy fix was to just remove the whole domain parameter from the setcookie()
   function call. I’m not an expert with cookies, but from what I can tell, the 
   domain parameter is optional, and if it’s left out, the current domain is assumed.
   So, by simply removing the domain parameter, the theme switching link seems to
   be working on my sites. Or at least, except for issue number 2….
 * 2. I’m not completely sure about this one, as I haven’t had time to have a proper
   dig into the code, but the issue is that the plugin doesn’t switch themes after
   the first click of the switcher link. The theme only switches after I do a refresh
   or navigate elsewhere. The mobile theme in this case is a child theme of the 
   desktop theme. You mentioned some people have reported problems with child themes,
   and I think this might be the same issue. I’ve had a look at the code, but I’ve
   found some strange things that appear to be going on, and I’d need more time 
   to figure this one out.
 *  [jherndon](https://wordpress.org/support/users/jherndon/)
 * (@jherndon)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-mobile-smart-redirect-doesnt-load-desktop-css/#post-2554547)
 * Had the same “naked’ url issue, the above fix worked for me as well.
 * For clarity changed lines 963 & 964 from:
 *     ```
       COOKIEPATH,
       str_replace('http://www','',get_bloginfo('url')));
       ```
   
 * to just one line:
 *     ```
       COOKIEPATH);
       ```
   
 * Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘[Plugin: Mobile Smart] Redirect doesn't load desktop css’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/mobile-smart_000000.svg)
 * [Mobile Smart](https://wordpress.org/plugins/mobile-smart/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mobile-smart/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mobile-smart/)
 * [Active Topics](https://wordpress.org/support/plugin/mobile-smart/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mobile-smart/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mobile-smart/reviews/)

 * 6 replies
 * 4 participants
 * Last reply from: [jherndon](https://wordpress.org/support/users/jherndon/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-mobile-smart-redirect-doesnt-load-desktop-css/#post-2554547)
 * Status: resolved