Software Engineering in WordPress, PHP, and Backend Development

Category: Notes (Page 29 of 49)

Notes on programming-related problems that I’ve encountered while working on various projects.

Merry Christmas

Merry Christmas!

Merry Christmas!

My family – in-laws and all – are celebrating Christmas, so we’re spending the day exchanging gifts, visiting with one another, and enjoying the time off.

If you’re celebrating Christmas – or any other holiday, or even nothing at all – I hope you guys have a great time!

Back to the regularly schedule content tomorrow :).

An Easy Way To Check if a Post is Paginated

Out of the box, WordPress supports the ability to paginate individual posts.

For those who aren’t familiar, it means that you’re able to literally paginate your posts such that a post may consist of multiple pages (kind of a weird concept, huh?).

Paginated Posts

Some people may use this feature, some people may not; however, if you’re working on a theme, then you need to be prepared for this case and provide appropriate styling.

But the way if which you determine if a post is paginated or not can lead to a bit of cluttered code, so in order to keep the code as readable as possible (and to keep the logic separated from the template), here’s one way that you can check is a post is paginated.

Continue reading

Contributing To WordPress 3.8 (And Future Releases)

The first time that I talked about contributing to the WordPress codebase was just over a year ago today.

Time flies.

Granted, I’ve made other contributions that have been made to the WordPress project since then – updating Codex articles, working on the JavaScript standards, and so on – but I’ve not actually had a chance to commit code to the project until this release.

And like many of the people who are using WordPress 3.8 for the first time today, I’m more excited about this release than I have been for a long time.

Continue reading

How To Add a Class to a Single Post in WordPress

As I’ve continued to work on the theme that I’m planning to use after Standard (and that I’ hoping to begin dogfooding within the next month or so), there have been a couple of features that I’ve wanted to implement for the sake of styling.

For example, there are times where I want to be able to style a single post, and though there are a number of ways one can go about doing this, I like to try to be consistent in how I approach the solutions I implement.

To that end, I’ve wanted to add a custom class name to a single post but only only the single post page.

Continue reading

Add a Custom Wrapper To The WordPress More Tag

Most of the popular CSS frameworks that are available today offer some sort of grid system for us to use such that we can arrange our content in rows and columns. This is advantageous for a number of reasons, the least of which is not for aiding responsive design.

When it comes to WordPress, one of the most common elements that authors will use is the `more` tag.

Just as there are times where we may want to indicate that a class has (or doesn’t have) a `more` tag, we may also want to wrap the tag in a row with columns on either side of the tag.

This gives us flexibility in styling the tag not only by helping to place the text by using columns and/or offsets, but also by taking advantage of a grid in the context of responsive design.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑