How to add version of
style.css in WordPress like below i can do in Joomla.
<link rel="stylesheet" href="/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
Per the Codex, here are all the parameters that
So for example to load a stylesheet with a version number you'd do the following:
You can achieve this using one of the following ways :
1) Add following tag in header.php file of the theme.
2) Add following code in functions.php file of the theme.
For more information see this page.
the best way to load css into your wordpress theme is the following code in your functions.php file:
This is the right way to load the styles in your theme and also it's the best for staging/testing purposes because each refresh will deliver the updated version of the style.
If you want to avoid the loading 1st way, you can use this shorted version and place the following line into your header.php file and will get the same result:
This is pretty straight up way of getting the version number by calling the function
Thats all there is to it. Hope that helps or is useful. You can go through all the parameters available and see what you can output with the
Ignore my comment since @Ravs has pointed out my error regarding the 'versions' parameter for the bloginfo() function. It does indeed print the Wordpress version number.