Making Your First WordPress Widget
Sidebars were one of the oldest features of WordPress as a publishing platform, and widgets have been in WordPress for years. This little quick guide walks through the process of making your own widget. Why would you want to?
Understanding Copies & References in PHP
The inner workings of PHP aren’t something most WordPress developers need to worry about too much. Especially if you focus on the front end and are a master of flex-box (I’m neither) you probably can safely never understand the subtleties of copies and passing-by-reference in PHP (or any other programming language). But as you make more complex plugins, this stuff starts to get kind of important. Important enough that you should read this great article by our friend Josh Pollock and get at least a little familiar with it.
New Theme Features in the Works for WordPress 4.7
I’m a bit behind the eight-ball on this. But I’m pretty excited by some of the new theme features that are in the works for WordPress 4.7. The most interesting to me is the new get_theme_file_uri() function, which will be a child-theme aware method of easily linking to your theme resources. Got that? It’s cool because:
As its GitHub documentation notes, the single-file PHP script searchreplacedb2 is “not terribly pretty, but it’s portable and it solves an important problem that comes up whenever WordPress sites get renamed.”
WordPress’s Crusade against Technical Responsibility
Andrey “Rarst” Savchenko is one of my favorite WordPress personalities. He’s one of only a few people who really love WordPress a lot, but also sometimes struggles to like it. It’s how I feel a lot too. And this post from him highlights so clearly the cause for a lot of that concern:
WordPress Coding Patterns: Setting Function Options with $args
Today’s topic is a pattern in WordPress programming called $args. It crops up all the time—so often that simply understanding it will make you a significantly more confident WordPress programmer. Let’s take a look!
Spelunking into the Template Hierarchy
The template hierarchy is one of my favorite features in WordPress. It not only makes child themes possible, but it also makes the whole ecosystem better because more code can be written to sit in smaller and smaller chunks. This is great. What’s also cool about it is that it’s all enabled by a few relatively small chunks of code. But staring at them starts to expose us to some of the most interesting parts of WordPress.
How to Add Existing Taxonomies to WordPress Custom Post Types
This article covers how to add existing taxonomies to a custom post type, and how to make that custom post type show up in those taxonomies’ archive pages.
Above and Beyond: Avoiding PHP Timeout and Memory Limit Errors with Ajax
Unlike some other programming languages, PHP shuts down completely the moment it stops processing a specific request.
Unconditionally: Refactoring Nested If-Statements for Cleaner Code
There’s a lot to say about writing clean code: Earth’s smartest people have spent a hundred or so years discussing the topic, and it doesn’t look like they’re winding down.