how to add version of style.css in wordpress

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');

Leave a Comment