I have a website that has been built using the bones wordpress theme. No matter what I do I can’t seem to get versioning to work on css and js using the wordpress enqueue functions.
Is there something in bones, maybe a filter that I can’t find that is stripping the versioning out?
Any suggestions are appreciated.
Thanks
You’re probably lucky that it’s not there by default, most people try and remove it as it defaults to WordPress version number (why?).
I found the best way to add it is to add the my_wp_default_styles function to your functions.php. Also a neat trick is to check the last modified date of the main css file and make that the version timestamp.
I found it !
There’s a filter into Bones theme, which remove every CSS/JS versionning.
Just look into the
bones-theme/library/bones.php
file, you got a filter functionYou can either edit it or just remove the hook, and place your versionning inside wp_enqueue_script()/wp_enqueue_style() functions.