How to add version of style.css
in WordPress like below i can do in Joomla.
<link rel="stylesheet" href="https://wordpress.stackexchange.com/templates/example/css/style.css?v=1.2">
i know that the style.css
will load dynamically. please help me to how to do that.
Version number is a parameter of wp_enqueue_style()
.
As per the Codex, here are all the parameters that wp_enqueue_style
accepts.
wp_enqueue_style( $handle, $src, $deps, $ver, $media );
So for example to load a stylesheet with a version number you’d do the following:
function wpa_90820() {
wp_enqueue_style('my-styles', get_stylesheet_directory_uri() .'/my-styles.css', array(), '1.0' );
}
add_action('wp_enqueue_scripts', 'wpa_90820');