Saedawke
Saedawke

Reputation: 471

Wordpress how to tell my css version

am developing wordpress theme, the wordpress automatically adds up my style.css but it assigns with version number which i don't now where it takes the value of version the below link is the one wordpress system adds to my head section of every page while the css version is 4.3.1.

<link rel='stylesheet' id='twentytwelve-style-css'  href='http://localhost/xyzwebsite/wp-content/themes/twentytwelve-child/style.css?ver=4.3.1' type='text/css' media='all' />

and i want to be like this

<link rel='stylesheet' id='twentytwelve-style-css'  href='http://localhost/xyzwebsite/wp-content/themes/twentytwelve-child/style.css?ver=3.8.11' type='text/css' media='all' />

Upvotes: 0

Views: 3165

Answers (1)

dingo_d
dingo_d

Reputation: 11670

If I'm not mistaken, you need to have in your style.css

/*
Theme Name: ThemeName
Version: 1.0.0
Author: yourname
Author URI: http://yourwebsite.com
Description: your description
Theme URI: your theme URL
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: random tags go here
*/

Right on top. Also in your functions.php file you'll need

<?php
define('THEME_NAME', 'ThemeName');
define('THEME_VERSION', '1.0.0');

And then just enqueue it in functions.php with

wp_enqueue_style('main_css', get_stylesheet_uri(), array(), THEME_VERSION);

You can make it dependent on other stylesheets if you want in the array, and the theme version goes after it.

Upvotes: 4

Related Questions