I have a query which looks like this:
<?php
$args = array(
'post_type'=> 'user',
'showposts'=> -1
);
$users = new WP_Query($args);
echo '<pre>' .print_r($users->posts, 1). '</pre>';
?>
The query returns all posts that exist. I now want to add a filter to search by category. Be aware this is custom post type and the categories was a taxonomy.
When i hover over the categories in wordpress it shows the related id’s. However when i try to filter by that id, it does not work 🙁
Any ideas?
This will query the posts of “user” type having categories defined by
category_user
taxonomy of IDs 1, 2 and 3 :Read more : http://codex.wordpress.org/Function_Reference/WP_Query#Taxonomy_Parameters