Forums

WP-Cache mfunc problem (7 posts)

  1. Stefanie
    Member
    Posted 4 years ago #

    I am using YARQ (Yet Another Random Quote plugin), and have set set up the mfunc comments around the php function call for it so it will not be affected by WP-Cache. When I load a page that has YARQ displayed, it loads fine, but if I click refresh, the quote, and everything beneath it in the sidebar, disappears, despite the mfunc comment being closed.

    Here is the code in my sidebar for YARQ:

    <!--mfunc yarq_display()--><?php if (function_exists('yarq_display')) { yarq_display(); } ?><!--/mfunc-->

    Did I do something wrong? Does anyone know why this is happening?

  2. Stefanie
    Member
    Posted 4 years ago #

    Anyone?

  3. Adam Lee
    Member
    Posted 4 years ago #

    Bump.

    I'm having the same issue and would also appreciate any suggestions.

  4. siffring
    Member
    Posted 4 years ago #

    I am having a similar issue. Has anyone successfully implemented mfunc around some dynamic content with wp-cache enabled?

  5. The-RockeR
    Member
    Posted 3 years ago #

    Hi, the problem is that you have to put a blank space before "mfunc" and "/mfunc" and after them. Like this:

    <!-- mfunc yarq_display() --><?php if (function_exists('yarq_display')) { yarq_display(); } ?><!-- /mfunc -->

    I think this should resolve the problem :)

  6. wvoelcker
    Member
    Posted 3 years ago #

    The wp-cache readme file is misleading on this, which is a bit silly.

  7. wvoelcker
    Member
    Posted 3 years ago #

    AH - if you put spaces into the comments, as suggested by the RockeR, then I think all that does is turn the mcfunc comments into normal comments (i.e. stops wp-cache parsing them at all).

    However, I've just managed to get this working, and it seems the solution (for me) was to make sure the functions I was calling are loaded BEFORE wp-cache, which I achieved by moving them to the bottom of this file:

    /wp-content/advanced-cache.php

    Cheers

Topic Closed

This topic has been closed to new replies.

About this Topic