0

I'm trying to figure out why I'm not seeing the stylesheet version number is my browser, when I add the version number to the enqueue function, where I enqueue the stylesheet.

Here's the code:

wp_enqueue_style('sage/main.css', asset_path('styles/main.css'), array(), '1111111' );

Using the version number '1111111' just to test.

When I inspect in my browser, I still see the stylesheet without a version number (client name obscured for privacy):

<link rel="stylesheet" id="sage/main.css-css" href="http://localhost:8000/wp-content/themes/XXXX/dist/styles/main.css" type="text/css" media="all">

The styles are loading and everything else is correct, just missing the version number. What am I missing?

(This is a laravel site.)

3
  • 3
    If it's a Laravel site why (and how) are you using a WordPress function wp_enqueue_style()? Sep 22 at 21:04
  • Hey @JacobPeattie, great question. I found this resource online that explains how to integrate laravel with wordpress: wpengine.com/resources/wordpress-laravel Sep 23 at 13:16
  • As best I can guess, you're using Acorn and Corcel in your theme in order to use Laravel within WordPress?
    – bosco
    Sep 23 at 18:13

1 Answer 1

0

It appears you're using the Sage theme framework - presumably you're also using Soil? One of Soil's modules explicitly disables asset versioning - ensure that you haven't enabled in it in your theme by way of

add_theme_support( 'soil-disable-asset-versioning' );

or

add_theme_support( 'soil', [ 'disable-asset-versioning' ] );

If Soil is not responsible it could be any number of other plugins - in particular any sort of caching/optimization plugin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.