Tom McFarlin

Software Engineering in WordPress, PHP, and Backend Development

Page 106 of 428

How to Display Recent Custom Post Types (Excluding the Current Post)

Let’s say you’re working on a page template and it’s going to include a partial that’s going to display recent custom post types (or maybe even the standard post type) of the post type you’re viewing.

For example, say you’re looking at the example of stories or something like that. And you’re looking at a single page for a given author. Then, perhaps in the sidebar, it reads Read More From Other Authors, and it retrieves stories from up to five other authors.

Display Recent Custom Post Types

Where additional custom post types may appear.

Writing a custom WP_Query, pulling back the five most recent posts, and dropping them into the selected area seems easy enough, right?

And it is. But there’s a gotcha.

Continue reading

Using Xdebug with Valet and WordPress

Though I’m not a fan of strictly using var_dump or echo statements as a way to debug code, that doesn’t mean there aren’t times in which they are useful (otherwise, they wouldn’t be part of the language, right?).

But what if you’re using Laravel Valet (which is easy enough to setup for WordPress) and you’re trying to display some multidimensional array and rather than getting some nicely formatted output, you end up getting one long line of text in Times New Roman? Odds are this is because you don’t have Xdebug.

Using Xdebug with Valet and WordPress: Valet

It’s easy enough to do, but it’s predicated on a few different things. Plus, once you get Xdebug installed, then you’re able to use a debugger with your code, as well. That’s not the point of this post, though.

Continue reading

On Improving Content Across the Board

When I last published, it was all about taking a break from social media and why I think it’s useful.

But I ended up not only doing that. Instead, I also took a break from writing (which save for a recent trip is not something I usually do). When you end up taking that kind of time off from writing, you can’t help but build up a backlog of ideas for content that will eventually find its way to be published.

Before getting back into the usual routine, I thought it worth sharing some upcoming plans I have for the site that will impact those of you who read regularly and those of you who may be new readers or who are just stumbling across this post.

Continue reading

Social Media Breaks Are Good for the Soul (I Think)

Not too long ago, I took a break from social media for two reasons (one no more important than the other):

  1. to try to break the habit of compulsively checking social networks whenever I was stuck on a problem,
  2. to cut back on “chatter” during the day.

(I looked through my previous posts to see if I talked about it at length but couldn’t find it.)

https://twitter.com/tommcfarlin/status/880912831922753536

Anyway, it’s something I’ve decided to do again, although this time I have a few different reasons. Maybe it’s social media breaks are something I’ll do a more on the regular, maybe not. I can’t know that right now.

We’ll see in a month.

Nonetheless, this time I thought it worth sharing a little bit more behind the reasons why if for no other reason to make sure I have it documented more so than I did last time.

Continue reading

A Few More Spotify Playlists for Work

Towards the end of last year, I shared a list of Spotify playlists for work that seemed to garner a good response if for no other reason than offering up some additional things to check out on my own 😇).

Since a few months have past and I’ve had a chance to listen, evaluate, and come up with a few more playlists to share I thought why not share another list?

Spotify Playlists for Work, Volume 2

So just as I shared towards the end of last year, here’s a list of the ambient music or the soundtracks I’ve been listening to as of late.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑