• I’m trying to use http://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.

    http://wordpress.org/extend/plugins/w3-total-cache/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter wpkoi

    (@wpkoi)

    Anyone who could help in this matter?

    What I’m basically trying to achieve is to be able to use page cache and still use server side mobile detection, to be able to not serve ads via javascript to some users.

    kokoschka

    (@kokoschka)

    Hi wpkoi, did you manage to solve this problem?
    I face the exact same problem and I haven’t found a working solution yet.

    leaase

    (@leaase)

    Hello

    I’m having the same problem, and I would love to use both w3 total cache and Mobile Detect. Please someone find a solution 🙂

    jtwg

    (@jtwg)

    Do the detection client-side instead.

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.