• I am using Argent as my theme (with a child theme), and I need to add a version number to the style.css sheet for cache busting purposes. I’ve Googled this, and tried all the top methods for doing this such as adding a version number to wp_enqueue_style, adding this code to functions.php of my child theme, using filemtime as mentioned as method #2, and adding wp_get_theme()->get('Version') as mentioned under #1, here.

    None of these methods have worked, mostly having no effect, and then occasionally crashing my staging site where I’ve been testing this. What can I use that will work?

    Here’s the relevant code from my child theme’s functions.php:

    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    function my_theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
     
    }

    …And here’s the relevant code from the Argent theme’s function.php:

    /**
     * Enqueue scripts and styles.
     */
    function argent_scripts() {
    	wp_enqueue_style( 'argent-style', get_stylesheet_uri() );
    
    	wp_enqueue_style( 'argent-fonts', argent_fonts_url(), array(), null );
    
    	wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.4.1' );
    
    	wp_enqueue_script( 'argent-js', get_template_directory_uri() . '/js/argent.js', array( 'jquery' ), '20150326', true );
    /* Change version from 20120206 */
    	wp_enqueue_script( 'argent-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );
    
    	wp_enqueue_script( 'argent-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
    
    	if ( 'jetpack-portfolio' == get_post_type() && argent_get_gallery() ) {
    		wp_enqueue_style( 'argent-slick-css', get_template_directory_uri() . '/js/slick/slick.css' );
    		wp_enqueue_script( 'argent-slick-js', get_template_directory_uri() . '/js/slick/slick.js', array( 'jquery' ), '1.4.1', true );
    	}
    
    	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
    		wp_enqueue_script( 'comment-reply' );
    	}
    }
    add_action( 'wp_enqueue_scripts', 'argent_scripts' );
    
    function argent_excerpt_length( $length ) {
    	return 20;
    }
    add_filter( 'excerpt_length', 'argent_excerpt_length', 999 );

    Any help is appreciated! Completely at a loss, though I’m sure it’s something very simple that I’m missing. Happy to go through re-trying any of the above methods, if helpful, too.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Nothing Working to Version CSS Sheet’ is closed to new replies.