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.
Demystifying Theme “Frameworks”
I was browsing around yesterday looking for topics to write about in WordPress and I came across someone asking a question that is kind of common: What’s a theme framework? Is _s one? Is Genesis? What about X Theme?
Course: Working with WP_Query
The WP_Query API uses a programming style called object-oriented programming, or OOP. Every WP_Query is actually a WP_Query Object, meaning an individual instance of the broader WP_Widget Class. If this setup doesn’t make sense to you, you’ll want to quickly learn the basics of object-oriented programming (OOP):
Practical Uses of pre_get_posts
In WordPress, pre_get_posts is a filter that makes it possible to modify an existing WP_Query, before that query is actually run. pre_get_posts offers some solutions that are more performant than writing a custom WP_Query, and enables solutions to other problems that would be quite difficult otherwise.