G'day, my name is

Phil Kurth

and I'm a web developer

DIG IN

October 2019

How to set defer or async attributes on enqueued script tags in WordPress

If you get down to business with performance optimisation, you could find yourself looking at ways to defer your scripts or even load them asynchronously. As far as I'm aware, WordPress' built-in functions wp_register_script() and wp_enqueue_script() don't currently take arguments for defining these attributes. But, with WordPress being WordPress, there is usually a way and […]

October 2019

Working with empty jQuery objects to build dynamic selectors

This is one of those techniques that you don't really think you need until you find yourself in a situation where you do. This definitely isn't a hammer and more often than not, you can select what you need in a single selector via jQuery or through the use of the built-in .filter() method but […]

October 2019

How to customize the colour palette for WordPress' Gutenberg block editor

Building on yesterday's tip, I'm putting this up to show how easy it is to register a custom colour palette for WordPress' block editor; AKA Gutenberg. It's actually something we can register as a theme feature so it's all doable on the PHP side and is very straight-forward. Here's the code you need;