• Works perfect. Literally, install, activate, it just works. Was having problems with every browser (FF, Opera, Chrome, IE, Safari, etc.) needing to be forced with F5 to refresh current css style (lasting only for that session), and user coming to the site were seeing OLD CACHE css — now I am happy! THANK YOU… PS I tried a dozen ways, functions, functions.php, techniques, tutorials, codes, snippets, etc. YOURS IS THE ONLY ONE THAT WORKED!

    THANKS!!!

Viewing 1 replies (of 1 total)
  • Thread Starter JJNW

    (@jjnw)

    I jumped the gun. This actually worked for me… had to uninstall plugin because it stopped working. So, use this in functions.php

    function my_scripts_and_styles(){
    
    $cache_buster = date("YmdHi", filemtime( get_template_directory_uri() . 'css/app.min.css'));
    wp_enqueue_style( 'main', get_stylesheet_directory_uri() . '/css/app.min.css', array(), $cache_buster, 'all' );
    
    }
    
    add_action( 'wp_enqueue_scripts', 'my_scripts_and_styles', 1);

    Your file directory to / from css will be different… just adjust, retry, adjust, retry and try again. It will work, once you find the appropriate directory.

    To ensure it is working, just look at your “View page source”.

Viewing 1 replies (of 1 total)
  • The topic ‘Amazingly easy and it works!!!!!’ is closed to new replies.