By default, the wp_enqueue_style() function will put whatever version of WordPress that you currently have installed behind your CSS call like this:
<link rel='stylesheet' href='https://jeradsdesign.com/wp-main/wp-content/themes/jeradsdesign-wp/css/main.css?ver=5.8.2' type='text/css' media='all' />
$theme = wp_get_theme();
define(‘THEME_VERSION’, $theme->Version);
wp_enqueue_style(‘main’, get_template_directory_uri() .’/css/main.css’, array(), THEME_VERSION);
If your style.css file has “Version: 1.0” in the top commment, it will now output this:
<link rel='stylesheet' href='https://jeradsdesign.com/wp-main/wp-content/themes/jeradsdesign-wp/css/main.css?ver=1.0' type='text/css' media='all' />
January 6, 2022 by Jerad
Tagged: coding, css, web development, wordpress