• 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 hits 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)
  • Hi there,

    That’s outside the scope of support for this theme. I suggest asking in the Advanced WordPress forum:

    https://ww.wp.xz.cn/support/forum/wp-advanced/

    Another good resource of information is Stack Exchange:

    https://wordpress.stackexchange.com/

    Thread Starter hastibe

    (@hastibe)

    Okay, thanks–I have re-posted it on the Developing with WordPress Forum. Here’s to hoping third time’s the charm!

    Thread Starter hastibe

    (@hastibe)

    Since this thread isn’t locked, yet, I just wanted to reply here to thank @joyously for the last response (here)–that did the trick, thank you SO much!

    Also, I want to point out to @t-p, @fstat, and @jdembowski that I first made this post in the Fixing WordPress Forum (here), at which @t-p recommended posting in the Theme: Argent Forum. So, I re-posted it there, at which point @fstat said I should be posting it in the Developing with WordPress Forum. So, I re-posted it there, at which point @jdembowski moved the thread back to the Fixing WordPress Forum, locked it, and said to “Please use that theme’s support forum instead as suggested.”

    I understand and appreciate the importance of moderation and that its purpose is to help people actually get the help they need, but this has been confusing (if my question hadn’t been answered by @joyously in the nick of time, I wouldn’t have known what to do with my question, at this point), and leaves me feeling like my question is unwelcome here.

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

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