Denoteone
Denoteone

Reputation: 4055

WordPress Genesis Style sheet version

I am trying to understand why a version number being added to the end of my style.css like style.css?ver=1.9.2 when I edit the style sheet in my child theme folder I am not seeing those changes update on the page.

Can someone explain why the version is being added to the style sheet name and how do I find the correct file to edit so I can make updates to my layout and formatting.

Upvotes: 0

Views: 1891

Answers (2)

Thomas Higginbotham
Thomas Higginbotham

Reputation: 1792

From http://blackhillswebworks.com/2013/10/11/force-browser-cache-to-reload-css-genesis-wordpress-w3-total-cache/:

Genesis child themes include a few lines of code in functions.php that define the child theme name and URL, and some themes also include a line that defines the child theme version. Genesis appends a version number to the style.css stylesheet link for us already, and you can see this by viewing the page source of a Genesis-powered website and looking for the stylesheet link to the theme’s style.css file.

If the child theme version is not defined in functions.php, then Genesis appends the installed version of Genesis to style.css by default. So the CSS stylesheet file name for a Genesis website using Genesis 2.0.1 that does not have a child theme version defined in functions.php is going to be style.css?ver=2.0.1.

If the child theme version is defined in functions.php, then Genesis appends that version number to the stylesheet link.

//* Child theme (do not remove)
define( 'CHILD_THEME_NAME', __( 'Agency Pro Theme', 'agency' ) );
define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/agency/' );
define( 'CHILD_THEME_VERSION', '3.0.20131011' );

Upvotes: 2

KatieK
KatieK

Reputation: 13853

A query string (the stuff after the ?) is most commonly applied to external assets like stylesheets to ensure that the web browser uses the most recent version of the file, rather than one from the browser's cache. Your web server will (in most cases) return the style.css file even if it can't find something with the ?ver=1.9.2 query string.

style.css is the name of the CSS file. You may have to manually clear your browser's cache, or increment the query string to 1.9.2.1 to see the new styles.

Upvotes: 0

Related Questions