[Resolved] viewing style.css version number in dev tools

Home Forums Support [Resolved] viewing style.css version number in dev tools

Home Forums Support viewing style.css version number in dev tools

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #333450
    Caroline

    Hi – I’m having trouble viewing the version number for style.css in dev tools for both my child theme, and for the parent theme. When I use the ‘sources’ tab in dev tools to view the file name for both these files it simply displays ‘style.css’.

    I can see the wp_enqueue_style() code in functions.php which includes a parameter for the timestamp to generate a version number, so I really can’t figure out why it’s not showing up! Also, when I look at the ‘sources’ tab in dev tools for this website (generatepress.com) it shows the file name and version number (ie style.css?ver=1497116279); I’m assuming the functions.php code is the same, so I’m confused as to why it’s not showing up for my site.

    Can anyone help?

    #333497
    Leo
    Staff
    Customer Support

    Hi there,

    Are you using a caching plugin? Can you provide a link to your site? Thanks!

    #333500
    Caroline

    Hi Leo – no, I’m not using a caching plugin. Would it be possible to send you a link to the site privately? It’s a staging site and I’m not quite ready to release it to the world yet!

    #333522
    Tom
    Lead Developer
    Lead Developer

    Are you using a plugin or code snippet that hides query strings? For example, see the “Remove Query Strings” section on this page: https://generatepress.com/fastest-wordpress-theme/

    #333530
    Caroline

    Yes indeed! I am using this:

    function remove_css_js_ver( $src ) {
    if( strpos( $src, ‘?ver=’ ) )
    $src = remove_query_arg( ‘ver’, $src );
    return $src;
    }
    add_filter( ‘style_loader_src’, ‘remove_css_js_ver’, 10, 2 );
    add_filter( ‘script_loader_src’, ‘remove_css_js_ver’, 10, 2 );

    Trying to get my Google speed insights score up! Am I going to need to remove it?

    #333544
    Tom
    Lead Developer
    Lead Developer

    Yes, if you want query strings. Personally I find them really helpful – stops caching issues ๐Ÿ™‚

    #333593
    Caroline

    OK, thank you! I’ve used that particular wp_enqueue_style() parameter to solve caching problems in the past which was why I wanted to address the issue in case I had problems again – I just didn’t know the output was called a query string so didn’t make the connection with the code snippet.

    Thanks so much for the quick and helpful reply!

    #333753
    Tom
    Lead Developer
    Lead Developer

    You’re very welcome! ๐Ÿ™‚

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.