WP_Query on custom taxonomy -> Location and Activity
WP_Query on custom taxonomy -> Location and Activity
WP_Query on custom taxonomy -> Location and Activity
Having trouble querying multiple custom taxonomies
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
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
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
Have a look at this tutorial for a possible solution: How To Show/Hide WordPress Meta Boxes By Selecting Categories. Basically, all of the taxonomies would be hidden via javascript, and a function attached to the click event of the Animals taxonomy, which inspects the selected item’s ID to show a corresponding child taxonomy. You’d also … Read more
$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
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); ……
You are going to have to get into URL re-writing which is notoriously pretty complex. However, there are several good answers on this site explaining how to do something similar. This one in particular Many to Many Taxonomies or rewrite rules? I also followed the tutorial Advanced Taxonomy Queries with Pretty Urls… which is very … Read more
I believe your error is in the if ( $taxonomies ) statement, I believe you want if ( is_taxonomy( $taxonomy ); ) see this link for further usages. I’m not at home so I can’t test this, but I think the option you present should work, as mentioned here. $args = array( ‘name’ => array( … Read more