Dynamic stylesheets with WordPress (and enqueue-ing from shortcodes)

Dynamic styles allow you to control CSS output with PHP on-the-fly, based on your plugin’s options or simply instead of a preprocessor.

Continue reading →

WordPress launch checklist

A list of 10 non-development tasks that I find myself doing when launching any website powered by WordPress

Continue reading →

From ACF to CMB2

I recently updated a large plugin from ACF (Advanced Custom Fields) to CMB2 (Custom Meta Boxes v2) and I’m glad I did — here’s why!

Continue reading →

Trigger 404 page in WordPress

Sometimes you need to throw a 404 if certain conditions are met and doing so in WordPress requires a little trickery to achieve the full effect.

Continue reading →

Reconciling WordPress & MVC

WordPress might not use the MVC pattern but following it in your plugins is easy with just a minor change in perspective.

Continue reading →

How to change a MySQL database’s table prefix

Changing a database table prefix is easy and here’s the simple step-by-step guide! For WordPress installations, it’s essential!

Continue reading →

Easy WordPress file and database permissions and ownership

This post is short — no intro to UNIX file permissions or a plethora of commands, just how to easily setup WordPress file & database permissions!

Continue reading →

Get a substring between two strings in PHP

So you need to get a substring between two strings? A quick Google returns about 101,000 results, the first three of which are from StackOverflow and solve the problem for rather specific use-cases. I wanted to solve the problem once-and-for-all in a more general-purpose way.

Continue reading →

WordPress: Find images without alt text

WordPress always adds an alt attribute to images added via the Media Library so finding images without alternative text is easy!

Continue reading →

Shortcode Tricks

Shortcodes are a great way to extend WordPress and as developers there are some pretty groovy undocumented tricks we can employ.

Continue reading →