How to change version of .css in WordPress?

Like the title suggests, I’m not too sure how to change the version of a .css file in my theme. At the moment the .css versioning is like this:

<link rel="stylesheet" id='xxxx'  href="https://www. site css/ styles.css?ver=4.6.1" type="text/css" media="all" />

Is there a script that I need to run – where should I be looking to make the version 4.6.2 as per above?

4

The fourth argument, $ver for wp_enqueue_style() allows you to set the version:

wp_enqueue_style( string $handle,
                  string $src = false,
                  array $deps = array(),
                  string|bool|null $ver = false,
                  string $media="all" );

Per the docs:

$ver (string|bool|null) (Optional) String specifying stylesheet version number, if it has one, which is added to the URL as a query
string for cache busting purposes. If version is set to false, a
version number is automatically added equal to current installed
WordPress version. If set to null, no version is added. Default value:
false

Leave a Comment