Software Engineering in WordPress, PHP, and Backend Development

Category: Notes (Page 29 of 50)

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

Adding Post Pagination Attributes in WordPress

Be sure to checkout this comment to see why adding title attributes may not be a good idea.

When it comes to working with pagination in WordPress, it’s relatively easy to manage:

  • There is pagination for index and archive pages.
  • There is pagination at the single post level.

Each of which usually consists of doing the following:

Enough enough, right?

But there are times in which you may want to add or enhance some of the attributes that are on each of these anchors.

Continue reading

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

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑