Querying multiple WordPress custom fields with AND qualifier

I’m not familiar with the exact way you’re doing it. I’m more familiar with the format that Scribu outlines on his blog.

I’d say you should at least be using quote marks on ‘rank’ and ‘Assistant Professor’, but there could be more to it.

If that’s not working out, you could go old school and use a pre 3.1 solution, such as the one I outlined on the WordPress.org Support forum. That’s using an SQL statement with aliases to find posts based on 4 Custom Fields.

It was posted a couple of years ago, so you might want to revise that for security – it should probably be using the prepare command for a start – but the basic concept should still work.

Leave a Comment