WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP Super Cache] Custom PHP code executed before serving cache page (7 posts)

  1. LucaTNT
    Member
    Posted 5 years ago #

    Hi everyone!
    I've been testing WP Super Cache for a while, and it's great!

    If I can make a request, I would like the cached page to be served through a PHP page, so that I can put some code in it to be executed *every* time a page is served.
    Would this be possibile?

    Thanks in advance and greetings from Italy!

    Luca

  2. Donncha O Caoimh
    Member
    Posted 5 years ago #

    Just make sure the plugin is switched to "Half on" and use one of the cacheaction hooks to execute your code. Look in the plugins directory and at wp-cache-phase1.php for example code.

  3. LucaTNT
    Member
    Posted 5 years ago #

    Thank you for your reply.

    I'm not a PHP newbie, but I'm not used to work on wordpress.
    Could you be so kind as to give me an example of how to make some code be executed after each page (cached or not, excepting admin area) is executed? So far I only managed to execute the code when the cache is created.

    Thanks in advance,
    Luca

  4. LucaTNT
    Member
    Posted 5 years ago #

    UP

    Can anyone help me?

  5. pavelzin
    Member
    Posted 5 years ago #

    Yeah, some problem here. Anyone?

    What I'm trying to do is to execute a php script every time a page is loaded. So in other words - is there a way, to - for example - not cache footer.php in the template file?

  6. Donncha O Caoimh
    Member
    Posted 5 years ago #

    LucaTNT - Sorry, I don't have time to go through it.

    Pavelzin - you could use an img tag to load a php script?

  7. LucaTNT
    Member
    Posted 5 years ago #

    Donncha - Ok, thank you anyway.

    If any other knows how to do it, please let me know.

Topic Closed

This topic has been closed to new replies.

About this Topic