Tom McFarlin

Software Engineering in WordPress, PHP, and Backend Development

Page 319 of 428

How To Efficiently Exclude Categories From The WordPress Loop

When it comes to writing custom queries in WordPress, `WP_Query` is the API to use. And I could be mistaken, but I do see a lot of people urging developers to avoiding using `query_posts` in WordPress in favor this newer-ish API.

But the thing is that `query_posts` still has its place in WordPress development namely in modifying the results of the data queried for The Loop when rendering blog content; however, one of the the biggest caveats is the performance that `query_posts` can have on the performance of the blog.

I’ve recently been working on a plugin where I needed to exclude posts from The Loop based on the category. At first, I was going to use `query_posts` but I ultimately hit a few snags, so here’s an alternative way to exclude categories from the WordPress Loop.

Continue reading

Register Now To Improve Your WordPress Development Skills

A couple of weeks ago, I shared a post in which I offered a class for helping you guys improve your WordPress development skills. Based on the feedback, emails, and tweets I’ve received, I’ve decided to move forward with the course.

I’m really excited about it, of course there are a few details that need to be worked out first.

But in the mean time, I’m looking to build up a mailing list of those who are interested so we can more easily communicate via mailing lists and email rather than blog comments and tweets :).

Continue reading

Attach Documents To WordPress Comments with Doc Comments

Earlier this month, I shared that I was releasing a WordPress plugin exclusively through the guys over at Foo called PDF Comments. 

However, in the last 25 days or so, I’ve received a lot of feedback generally saying that the plugin is something people need, but they need it to be more flexible in the document types that it accepts.

So I’ve officially rebranded PDF Comments as Doc Comments, updated the purchase page on Foo, and introduced support for a number of new document types.

Continue reading

Blogging Myths: Perfection, Focus, and Experiments

Comments are closed on this post. Please comment on the original post.

As someone who clearly loves to blog (as well as read what others have to say and build things for others to use), one of the things that I enjoy the most is hearing from others – specifically, family and friends – who want to get into blogging but aren’t sure where to start.

Blogging is a lot like Loch Ness: It’s a deep and wide sea that’s full of myths that can detract you from the actual site if you’re not careful.

Nessie isn't a myth. She's real. Okay? Okay.

Nessie isn’t a myth. She’s real. Okay? Okay.

Cheesy example, I know, but the truth is that there are several blogging myths all of which can seriously keep people at bay from pressing the publish button, and that’s a real shame especially if it’s an interest that they have.

Continue reading

Unicode Characters, Regular Expressions, JavaScript, and WordPress

For those who have been into computer science for any amount of time, you’re likely familiar with Joel Spolsky, his blog Joel on Software, and/or perhaps any of his books.

A couple of years ago, I read an article called The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!).

I’m not ashamed to admit that, at the time, it wasn’t very applicable to me. Yes, it was interesting, yes, I cared, but I didn’t have a practical way to implement it simply because there was nothing that I was working that warranted the information in the article.

But here was one of my biggest takeaways:

If you completely forget everything I just explained, please remember one extremely important fact. It does not make sense to have a string without knowing what encoding it uses. You can no longer stick your head in the sand and pretend that “plain” text is ASCII.

Fast forward a couple of years and I was working at a place where every piece of application code that we rolled out had to be internationalized because it was accessible by a variety of countries all across the world – now it was more practical (and it’s not much different than WordPress, huh?).

And now, I’m finding myself working more with unicode characters in WordPress more than I ever have before.

Here’s the thing that few people talk about: Sites, themes, or HTML in general will specify a character set that can drastically affect how the content in your page is rendered.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑