Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 169 of 258)

Personal opinions and how-to’s that I’ve written both here and as contributions to other blogs.

How To Find Posts Without Meta Data

I’ve been working on a very simple plugin lately – more of which I’ll talk about next month – that’s serving as a demo for a larger project that I’ve been working on.

In short, the plugin gives editors the ability to exclude posts from the main index feed of the WordPress blog. This means that the blog post is still accessible via direct URL, but it won’t show up in the main feed of the site.

This is achieved by the following process:

  • Introduce a meta box into the post editor dashboard
  • Add a check box that gives the user the ability to check whether or not to exclude the post
  • Use a hook to exclude those posts form the dashboard

It sounds easy enough, doesn’t it?

Continue reading

Disabling Post Comments on WordPress: Why?

A few days ago, I was talking with a friend about a post I’ve recently written in which I had disabled the comments.

The general question is basically:

Why disable comments?

And though it was a good question. Generally speaking, though not always, I try to be very deliberate with the choices that I make as it comes to how this blog looks (though it’s getting dated, I fear), functions, and what I opt to share.

But what kind of answer is that?  It’s not.  Continue reading

Open Source WordPress Themes: Going On GitHub

Over the last year or so, I’ve been hesitant to open source Mayer. I mean, by default, the theme is open source, but I mean placing it on GitHub. Coincidentally, I’ve never had a problem open sourcing any of my plugins no matter how low-quality they were (at least at the time – I mean, I didn’t know any better!).

I still have a lot to learn but that’s a topic for another post.

Anyway, so what’s the rub? That is, why is the only way to grab a copy of the source code of open source WordPress themes to purchase them? It kind of feels a little bit anti-GPL doesn’t it (and to be clear, I do not want to start a debate on this)?

The current GitHub page for Pressware

The current GitHub page for Pressware

But the software should be freely available. It’s the support – and the other perks that come with that – that matters the most, right? And I’ve watched other people be wildly successful with open sourcing their work (Pippin Williamson being one of them). Continue reading

Using WP_Query To Search For a Person

One of the most powerful features of WP_Query is that it allows for us to create a type of mini-search engine within the context of our WordPress projects.

No, this isn’t as sophisticated as something or someone who’s actually in the search business, but you can create some pretty elaborate queries using WP_Query.

Conversely, you can also create some pretty simple queries that do a good job of returning a subset of data. For example, say you’re interesting in using WP_Query to search for a person. There may be a little bit of criteria that the user has to provide, but doing something like this is usually really easy.

Continue reading

Maintainability of WordPress Theme Customizer Code

When working with the WordPress Theme Customizer, one of the things you may find yourself doing is writing out inline styles into one of the templates for your theme. Most likely, this will happen within the context of your header template since that’s where most of your styles and JavaScript sources are included.

Sure, it’s possible to handle a lot of the work via JavaScript and to use separate stylesheets to handle the general styles, but if you’re looking to set something up like, say, backgrounds that can be selected via the Theme Customizer, then you’re going to need to write out inline styles.

And if you’re in the habit of keeping your code separated such as styles reside in CSS files, behavior functionality resides in JavaScript files, and templates hold markup and PHP, then this can be a little bit annoying. It breaks the trend, you know?

There is somewhat of a solution to this, though.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑