WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: AdRotate] Using it with W3 Total Cache? (9 posts)

  1. nick74
    Member
    Posted 3 years ago #

    W3 Total Cache's FAQ on fragment caching gives these examples:

    * Example 1:
    <!-- mfunc any PHP code --><!-- /mfunc -->
    * Example 2:
    <!-- mfunc -->any PHP code<!-- /mfunc -->
    * Example 3:
    <!--MFUNC -->
    echo rand();
    <!--/mfunc -->
    * Example 4:
    <!-- mclude path/to/file.php --><!-- /mclude -->
    * Example 5:
    <!-- mclude -->path/to/file.php<!-- /mclude -->

    However when I use one of the above examples with my php code from AdRotate it won't work.

    This is how I put my php code into the examples above:

    Example 1:
    <!-- mfunc <?php echo adrotate_banner('2'); ?> --><!-- /mfunc -->
    Example 2:
    <!-- mfunc --><?php echo adrotate_banner('2'); ?><!-- /mfunc -->

    What am I doing wrong?

  2. Frederick Townes
    Member
    Posted 3 years ago #

    Try without the start/end PHP tags.

  3. nick74
    Member
    Posted 3 years ago #

    Thanks man! That works great!

  4. Frederick Townes
    Member
    Posted 3 years ago #

    Excellent.

  5. phrayzer
    Member
    Posted 3 years ago #

    Could either of you post the correct code? I tried adding and removing misc end tags, but all with disastrous results.

    :)

  6. nick74
    Member
    Posted 3 years ago #

    like this:

    <!-- mfunc echo adrotate_banner('3'); --><!-- /mfunc -->

  7. Frederick Townes
    Member
    Posted 3 years ago #

    Sure that could work.

  8. johnny_n
    Member
    Posted 3 years ago #

    This is a bit finicky, I've had to rotate through all the different ways of doing it before one worked, and then I just changed some minify settings (to not minify two fancybox javascript files) and it threw off AdRotate and I'm back to square one. You also get different messages with different mfunc usages as well...

    So if one works, try others. One eventually should work...

    john.

  9. Frederick Townes
    Member
    Posted 2 years ago #

    Thanks @johnny_n

Topic Closed

This topic has been closed to new replies.

About this Topic