Orderby Custom Field

I’m getting along pretty well with WordPress so far, and I’m still amazed to hear myself say that I actually enjoy it. But while I have plenty of CMS experience and even know PHP pretty well, I’m still a bit of a WordPress newb. This one still sort of has me stumped.

Using WP_Query to get a custom taxonomy and orderby a custom meta value

To someone not versed in WordPress speak, that sounds like a bunch of hooey. But all I want to do is get all posts from a category that I created and order them by a custom field that I also created. Like any good WordPress newb I turned to Google and came up with this:

In my mind that totally should have worked. But it was actually ordering the posts by an older custom field that I had deleted. By using Query Monitor I was able to see that it was still sorting by this old query—I still don’t know where it lived. Anyway, after a sleepless night and a few more hours of table-beating with my head, I tried simply removing the post-type parameter:

And boom! It worked exactly as expected. My only hang-up is that custom taxonomies can be mapped to more than one post type, so what if I really did need to indicate a single post type? Oh well. I guess I’ll find out when that need arises.