• Resolved graf1n

    (@graf1n)


    Hello!
    I include CSS styles in functions.php depending on cookies. How can I prevent the css block <link rel = “stylesheet” href = “/ wp-content / themes / flatsome-child / customstyles.css” /> from being cached?

    Included ESI, tried different markup in html, but it doesn’t work.

    I connect CSS like this:
    if ($ tempBlock == 1)
    {

    add_action (“wp_head”, “wp_head_extra_code”);
    function wp_head_extra_code () {echo ‘<link rel = “stylesheet” href = “/ wp-content / themes / flatsome-child / customstyles.css” />’;
    }

Viewing 2 replies - 16 through 17 (of 17 total)
  • Thread Starter graf1n

    (@graf1n)

    How can I show this random number in the browser?

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    This is the code I tested on my test site

    <?php
    echo apply_filters( 'litespeed_esi_url', 'my_esi_block', 'Custom ESI block' );
    ?>

    in footer.php which I want to display it

    add_action( 'litespeed_esi_load-my_esi_block', 'my_esi_block_esi_load' );
    
    function my_esi_block_esi_load()
    {
    do_action( 'litespeed_control_set_nocache' );
    echo "Hello world".rand (1,99999);
    }

    in theme’s functions.php

    Please try one.

    Best regards,

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘How to exclude cache’ is closed to new replies.