[Plugin: W3 Total Cache] Fragment caching and mobile detect
-
I’m trying to use https://mobiledetect.net/ with w3 total cache and fragment caching, but I can’t seem to get the markup right. No matter how I put the mfunc and mclude codes aroung this, it doesn’t seem to work.
This is how I use the mobile detect part:
<?php include 'wp-content/themes/popd/mobile-detect/Mobile_Detect.php'; $detect = new Mobile_Detect(); ?> <?php if ($detect->isMobile() && !$detect->isTablet()) { ?> <!-- me mobile, me like lightweight baby --> <?php } else { ?> <!-- stuff only for desktops --> <?php } ?>
How could I wrap this up so that it would work with w3 total cache? If I put it straight out there without any mfuncs of mcludes, this will get cached based on the first visitor and the following visitors doesn’t get the right version.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘[Plugin: W3 Total Cache] Fragment caching and mobile detect’ is closed to new replies.