• Basically, I’m trying to make my widget stay dynamic.

    I’ve tried all the variations of mfunc syntax, but the code it’s meant to protect from caching still gets cached.

    This is a sample of my code:

    <!--mfunc echo ( is_user_logged_in() ) ? 'logged in' : 'logged out'; --><?php echo ( is_user_logged_in() ) ? 'logged in' : 'logged out'; ?><!--mfunc-->

    I’m pretty sure W3 Total Cache reads the code properly as the mfunc tag disappears when viewed through the source code.

    Page cache: Disk Basic is the only option that’s enabled, everything else is disabled.

    If anyone knows a way to exclude the sidebar from getting cached I’ll gladly do that instead.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Having the same issue (as are many others on the Woocommerce forum) since my site uses Woocommerce pro and the shopping cart gets cached between sessions.

    Fragment caching *should* work (so as to not cache the cart dynamic plugin between sessions) but it doesn’t work, regardless .

    It would be great if W3 Total Cache had an “This Installation” tab in wp-admin which listed all currently installed plugins, pages and so forth and we could check a box to not cache certain pages and dynamic widgets.

    Anyone have a thought?

    Your syntax is wrong. Try this instead:

    <!--mfunc -->
    echo ( is_user_logged_in() ) ? 'logged in' : 'logged out';
    echo ( is_user_logged_in() ) ? 'logged in' : 'logged out';
    <!--mfunc-->

    The <!–mfunc–> comment tags actually REPLACE the <?php tags.

    That being said, after upgrading to the most recent version of w3 Total Cache on one of my sights, I am having an issue with mfunc – I get a 500 server error for the whole site. Then it’s fine if I revert back to <?php tags instead, but then my php code is no longer dynamic anymore.
    Not sure what the deal is with that..

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘mfunc gets cached’ is closed to new replies.