Posts

Thoughts, explanations, and musings, usually on web development.

Writing a Regular Expression to Target Images Without a Class

January 17, 2019

A while back, I wrote about building your own lazy loading functionality into WordPress. In that post, I use a regular expression to add a class to image tags that don’t already have any class. It failed. Rather than adding it to images with no…

Using the 'posts_where' Filter with WP_Query in WordPress

April 25, 2018

If you’ve spent 20 seconds in WordPress development, you’ve likely worked with, cursed, and fallen in love with the WP_Query class — one of the most useful, commonly used tools in any given WordPress website or application. Aside from being…

Preloading JavaScript Assets in WordPress

April 05, 2018

Squeezing every last drop of performance out of your website on any platform is an always-changing, never-ending, often addictive battle. Among the several tactics you can employ in this fight, optimizing your site’s resource hints is a modern…

Creating the Simplest WordPress Plugin

April 04, 2018

If you’re making modifications to the functionality of your WordPress site or application, there are generally two places where people put the code to do it. A theme’s functions.php file. A plugin. Given the choice, which option should you almost…

Let's Stop Making it Cool to Hate jQuery

March 19, 2018

When I started web development, beginning a new project often felt like drowning and then being asked to write JavaScript that worked. At the time, all I needed to do was perform some DOM stuff: make an element disappear on a click, add some classes…

Build Your Own Simple Lazy Loading Functionality in WordPress

February 23, 2018

When you’re looking to incorporate any given feature into your WordPress application, there’s rarely a shortage of third-party plugins out there to make it happen. But sometimes, whether you’re trying to avoid the inevitable complexity an unfamiliar…

Building a Lambda Function with Netlify

February 12, 2018

A while back, I wrote my first Lambda function with Firebase. Like every Lambda function tutorial on the web shows you how to do, mine processes a payment via Stripe when someone purchases a license for TypeIt, the most versatile JavaScript animated…