Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 204 of 219)

Articles, tips, and resources for WordPress-based development.

Writing Clean, Maintainable Custom WordPress Queries

Recently, I was having a conversation with a fellow developer via email about maintaining a separation of concerns in custom WordPress queries and WordPress templates.

The gist of the conversation boiled down to this:

Is it a good idea to keep custom queries in the template files?

A couple of years ago, I would’ve said yes but as I’ve begun to work on more complex projects, I’ve changed my mind: I’m actually a fan of keeping custom queries in functions.php.

I think that this keeps code more maintainable, cleaner, and easier to read, though I’m not sure if this is the most common practice.

Continue reading

How To Programmatically Create a Category in WordPress

If you're an advanced developer or just want the TL;DR version of this, skip to the code.

The majority of the time that I’m working on a contract project, there’s a need to programmatically create several parts of the website that occur during theme setup. Often times, this includes creating posts, users, and/or setting templates.

Ultimately, the goal is to make the user’s experience as nice as possible: They install the theme and the site, to a degree, has bootstrapped itself.

As with the aforementioned parts of a site, it’s also common to need to create a category, or categories, during theme setup. WordPress provides two ways of doing so, one of which often results in a PHP fatal error.

Here’s how to programmatically create categories in WordPress and do so without generating any errors.

Continue reading

WordPress Donations: Is There Shame in Asking?

In light of yesterday’s post and some of the discussion in both comments and offering support for various WordPress projects, I’m curious as to what you guys consider to be etiquette when it comes to asking for WordPress donations.

As I mentioned yesterday, I personally think that we have a personal obligation to provide a level of support for free software that we released; however, at one point is it socially acceptable to ask for a donation.

On top of that, where do you even draw the line?

Continue reading

WordPress Plugin Support: How Much is Too Much?

One of the nicest things about WordPress is how easy it is for developers to extend its functionality, and how easy it is for users to find plugins that help them enhance their blog.

All conversations about plugin quality and compatibility aside, WordPress plugin support is one area of development that often seems to be rarely discussed (unless I’m missing all the people talking about it!).

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑