WordPress Two Level Filters on Getting Custom Taxonomy Terms

It doesn’t make any sense querying with get_terms when: genre=”action” AND quality = ‘HD’ The reason is: The only term that has taxonomy genre equals to action, is action. And the only term that has taxonomy quality equals to HD, is HD. If you constrain them with AND, then basically you have nothing. Since there’s … Read more

Complex Taxonomy scheme

Set your system up like this: locations – CPT administrative – hierarchical taxonomy natural – hierarchical taxonomy type – non-hierarchical taxonomy In the administrative taxonomy, you would create your tree: countries on the first level, regions second, departments and so on. Then, you would assign your locations to the smallest administrative denominations among your taxonomies … Read more

How to create a list of terms who’s posts also have a predefined external term?

if i understand correctly you want to get a list of albums (posts) of a specific artist(taxonomy) and that are have ihaveit term. if so the its a simple query using tax_query: $args = array( ‘posts_per_page’ => -1, //get all ‘post_type’ => ‘album’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘artist’, ‘field’ => … Read more

Generate multiple tag query URLs

$url = parse_url( $your_url ); $query = $url[‘query’]; $args_arr = array(); parse_str( $query, $args_arr ); if( isset( $args_arr[‘param’] ) ) { $query_string = $args_arr[‘param’]; $query_string .= ‘,value2’; } else { $query_string = ‘value2’; } add_query_arg( ‘param’, $query_string ); That’s completely untested, but you get the concept. Basically, wordpress is gonna want to replace what you … Read more

Query multiple taxonomies with pagination

May be this will help: …….. …….. if(isset($_POST[‘genre’])) { $myquery = array( ‘showposts’ => 20 , ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘paged’ => $paged, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘anime_genre’, ‘terms’ => $_POST[‘genre’], ‘field’ => ‘slug’, ‘operator’ =>’AND’ ) ) ); } query_posts($myquery); ……