WordPress Query Multiple Taxonomies

June 29, 2011

wordpress

This example is for an employee directory. We created a custom post type called "employee". For that custom post type we created two custom taxonomies - "type" and "department".

Lets say we want to find employees in the technology department that are programmers.

$args=array( 
    'post_type' => 'employee', 
    'post_status' => 'publish', 
    'posts_per_page' => -1, 
    'caller_get_posts' => 1, 
    'order' => 'ASC', 
    'orderby' => 'title', 
    'type' => 'programmer', 
    'department' => 'technology' 
);
query_posts( $args ); 
// loop it

Hopefully this helps if you are looking to query multiple custom taxonomies from custom post types in WordPress. Have questions? Let us know in the comments!


Active Projects

Here are some of the projects I am currently working on. Some are side projects, some are client projects, and some are just for fun. I like to build things and I like to share what I learn along the way. If you have any questions about any of these projects, feel free to reach out.

๐Ÿ“ฆ Flow Export

Export Salesforce Flow to Miro to collaborate with your team. Read more about the launch of Flow Export on the Salesforce AppExchange.

๐Ÿค– Make Storytime

Personalized children's stories generated by AI. This is an app I am building with my kids.

๐Ÿ“  Fax Online

Yea, I know. But there is a long tail for everything and believe it or not there was an underserved market for people that need to send a fax online. Some people (like me!) just need to send a one time fax.

Read more about this micro Saas project in a blog post about building an online fax service.

๐Ÿ“ฑ Cloud Number

Cloud Number is a virtual phone app that helps you protect your privacy online. Use it to receive SMS online and keep your phone number private. It's also a great service for a freelancer or entrepreneur that wants to have a separate phone for their business for SMS and voicemail.

๐Ÿฅ‘ Free URL Indexer

Free URL Indexer is a free tool to help you index your backlinks and get them into Google faster. It's a simple tool that I built to help me with my own SEO efforts and I decided to share it with the world. It's a free tool and I don't even ask for your email address. Just paste in your URL and click the button.

๐Ÿ‘‰ See all projects