Just did a quick check and it seems the session for display mode is not set upon entering the site. I did a quick test by installing your 2.1 sql file to allow for the switches in all 3 header files. Once those switches are clicked the session is then set. So use the above code changes in I think 3 files to add another condition to the if statements. Taking the code above, add it to the beginning such as:
PHP Code:
if ([COLOR="#FF0000"]$detect->isMobile() && !$detect->isTablet() or[/COLOR] .... 2.1 code .... ) {
echo $responsive_mobile;
} else if ([COLOR="#FF0000"]$detect->isTablet() or [/COLOR] .... 2.1 code .... ){
echo $responsive_tablet;
} else {
echo $responsive_default;
}
This will now pull the correct js, css, php files needed for devices, tablets and desktop.

Originally Posted by
yaritai
Hi rbarbour,
I will give my input as I looked into your code for 2.1 a while back to do a small task for a friend. From what I did, the issue is not with the call to mobile detect as it is working. What his site is doing was to revert back to your older code without the session switch display and it does call the correct css responsive files. This is what I did to his:
PHP Code:
if ($detect->isMobile() && !$detect->isTablet()) {
echo mobile.css;
} else if ($detect->isTablet()){
echo tablet.css;
} else {
echo default.css;
}
When taking away the session display it works fine. It was a workaround as the switch was not important to him. So I guess for now, this may be the best alternative for those who want to use the winchester template and still have the capabilities of calling certain specific files.
I was looking at the session switch to see if that was causing the issue but didn't go further since it was not important to him.
Bookmarks