This year at WordCamp Philly, I learned a lot. Not only was it my first WordCamp, it was my first time presenting in front of a crowd of my professional peers. I was extremely nervous, but everyone in the room seemed to cope with my uncomfort, and I got a lot of well wishes from the audience at the end. Besides gaining experience as a speaker, I also pickup some tips from the community. There is one tip in particular that I’d like to share and thats the wp_enqueue_style function.
What is wp_enqueue_style?
The core function wp_enqueue_style, is a way to call your stylesheet so WordPress is aware of the stylesheet you are using. By doing so you can prevent that stylesheet from being called multiple times say by a plugin etc. The most powerful feature, however, is that offers you the option of using a version number.
Versioning Your Stylesheet with WordPress
So where then does versioning come in? Well say you’ve condesed all your stylesheets into one master version, you’ve run that file through the YUI compressor and you’ve saved it as a separate file say, style.min.css. What versioning can do is help your users make sure they’re seeing the latest version of your CSS.
Using WordPress’s core enqueue functions will really make your site faster, and more standardized. Be sure to consider them for your next build.
Do you use wp_enqueue_style? Do you version your files and minify before you push live? What other techniques do you use to make your site more efficient?