Tag: PHP







How to Conditionally Enqueue a JavaScript File in WordPress

Enqueuing is the WordPress way to add a stylesheet or JavaScript file on a page. We already published a Quick Guide about including your JavaScript in WordPress. This time, though, we’re adding an extra wrinkle: how do you only enqueue a JavaScript file on certain pages of your WordPress site. That’s the focus of this here Quick Guide.


A Code Snippet to Fix WooCommerce 3.0 Lightboxes

I truly love WooCommerce, but there’s one thing I don’t love about it: breaking changes. Working mostly in WordPress, breaking changes generally feel like something scary and challenging that I expect people in other environments to have to deal with—a bit like, say, cobras. The exception is WooCommerce, which brings the cobras right into my house.