Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 279 of 428)

Using WP_Query To Get Posts From Last Week

One of the most powerful aspects of the WordPress API is WP_Query as it allows us to retrieve a wide variety of content through a relatively simple interface.

That is, it allows us to retrieve complicated datasets ranging from custom post types, post status, date ranges, taxonomies, meta data, categories, and so on all with a relatively standard set of PHP constructs (mainly arrays) and with a really solid reference in the associated Codex article.

One of the nicest things about WP_Queryespecially since WordPress 3.7, are the advanced date query parameters that we can use in order to retrieve information from a specific date range without having to do a lot of complicated date math (which, of course, is every programmer’s favorite aspect of development).

If you learn how to use that particular aspect of WP_Query and you’re familiar with PHP’s strtotime function, then you can retrieve posts from a range of dates easily.

Continue reading

Bug Ticket Triage for WordPress Themes

One of the things that I try to do with my projects is to create quick, iterative releases. When it comes to client work, I’ve made a lot of progress with this over the past year; however, when it comes to working on products (be it plugins, themes, or something similar), I’m not as good as I’d like to be.

Nonetheless, I’m still working on it and one of the ways in which I’m trying hard to focus on that is through creating a system of bug ticket triage.

Sounds all fancy, right?

Sounds fancy.

It’s not :).

Basically, it’s a way that I sort tickets as they come into the support channel and decide how I’m going to be resolving them according to their level of severity.

Though I don’t think there’s a definitive way to do this, I thought it might be worth sharing how I’ve been doing this with Mayer (as well as some other client projects) in order to try to create the leanest release experience possible.

Continue reading

A Quick Fix For Google Web Font Rendering

Like many, Chrome is my browser of choice, but the past couple of updates have resulted in some problems specifically with Google web font rendering (as well as some other web font rendering).

I had considered linking to a number of different issues that I had seen in bug trackers, but you can see just how popular this particular issue has gotten by performing a quick Google search.

To be honest, I’m not sure if this is relegated only to Chrome or to all WebKit-based browsers.

Anyway, since Chrome normally does silent version updates in the background, this should be fixed in an upcoming version – last I checked, it was resolved in the latest build of Chromium – but until then, I thought it may be worth sharing one way to fix the issue.
Continue reading

Are You the Smartest Person in the Room?

Recently, I heard a quote that has stuck with me. I can’t remember word-for-word how it was used, but the paraphrase is:

If you’re the smartest person in the room, then you need to find another room.

It sounds a little weird (and potentially even a little offensive) without knowing the context.

In short, it was said during a conversation about leadership and the importance of surrounding yourself with other smart people (well, smarter people), knowing that just because you may be the first person at a place doesn’t make you the smartest, and not being afraid to ask for insight, criticism, and advice in a variety of areas.

The topic had nothing to do with programming, development, or anything remotely close to that; however, I’ve been thinking about not only how it relates to this particular industry, but how it relates directly to me and my career.

Continue reading

A Practical Example of The WordPress Heartbeat API

The WordPress Heartbeat API is not exactly a new feature. That is, it was first released in WordPress 3.6. Maybe I’ve just done a poor job of keeping up with what others are doing with the API, or maybe I’ve just not paid attention to some of the stuff that people are doing with the API, but I haven’t seen that many examples other than how to get started with it.

On top of that, the Heartbeat API codex is lacking in documentation (though this is an open source project, so if anyone’s to blame, it’s all of us), so perhaps that’s a reason that few people have begun to implement it into their projects.

Whatever the reason, I thought it may be worth showing a practical example of how I recently implemented it within a theme I’m working on, and how I’m using it within conjunction with the Theme Customizer so that when an administrator makes a change to the theme using the Theme Customizer, the visitor will automatically (or is it automagically?) see the changes.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑