Support » Plugins » wp-cache vs. wp-quotes

  • I’m terribly new to wordpress, so I apologize in advance if this is a dumb question.

    I downloaded WP 2.1.3, and a metric buttload of plugins. Two among them are the everpresent wp-cache, and one called wp-quote. That second one, if you’re not familiar, allows you to use a tag to display a random quote from a database each time the page is accessed.

    Problem is, when both are active, accessing any page with quotes causes a server error 500. Are the ideas of cached pages and random items on those pages mutually exclusive, or is there a way to make the two coexist?

    So far, I’ve tried:
    1) replacing the wp-quotes plugin with a quick one of my own devising. Doesn’t work — any randomized item breaks the page.

    2) disabling all other plugins — this is how I verified that the problem was with only these two plugins

    3) changing wp-cache’s options. No luck there.

    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Cal

    (@themesbycal)

    took this from the wp-cache readme file, hope it helps…

    = How do I make certain parts of the page stay dynamic? =

    It’s compatible with Staticze Reloaded. From their FAQ:

    There are two ways to do this, you can have functions that say dynamic or include entire other files. To have a dynamic function in the cached PHP page use this syntax around the function:

    <!--mfunc function_name('parameter', 'another_parameter') -->
    <?php function_name('parameter', 'another_parameter') ?>
    <!--/mfunc-->

    The HTML comments around the mirrored PHP allow it to be executed in the static page. To include another file try this:

    <!--mclude file.php-->
    <?php include_once(ABSPATH . 'file.php'); ?>
    <!--/mclude-->

    That will include file.php under the ABSPATH directory, which is the same as where your wp-config.php file is located.

    Thread Starter rumandcodedotnet

    (@rumandcodedotnet)

    Wow! R-ing TFM, what an idea….

    So, I surrounded the function call with the mfunc tags, as shown. Didn’t work. Thought it might be because the function call in question might be pulling from a wordpress function which obviously won’t exist when pulling the page from a cache. I removed the WP functions, moved it to a separate file, and used the php include and mclude tags above. It works perfectly when wp-cache is off, but when wp-cache is enabled, I still get a server error 500 on every second refresh.

    Here’s the funny part. Every refresh which DOESN’T cause an error seems to be working correctly. It does have a different tagline each time, and does have the comments at the bottom showing it was generated from the cache. If you want to see it in person, go check out the website which is my username.

    code in question:

    <!-- show random tagline (kept dynamic, so wp-cache won't break)-->
    <!--mclude random_tagline.php-->
    <?php include_once(ABSPATH . 'random_tagline.php'); ?>
    <!--/mclude-->
    
    <!--mfunc show_tagline()-->
    <?php show_tagline(); ?>
    <!--/mfunc-->
    <!-- end show random tagline -->

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp-cache vs. wp-quotes’ is closed to new replies.