Query by multiple custom taxonomies

Based on your code, if the url is: http://example.com/page/?eth=1&t=1 Then the resulting query will be: $tax_query_args = array( ‘relation’ => ‘OR’, array( ‘taxonomy’ => ‘filters’, ‘field’ => ‘slug’, ‘terms’ => array( ”, ‘twitter’, ”, ”, ”, ”, ”, ”, ”, ” ), ‘operator’ => ‘IN’ ), array( ‘taxonomy’ => ‘platform’, ‘field’ => ‘slug’, ‘terms’ => … Read more

how let users select categories for posts in frontend?

here is how to do it: <form action=”#” method=”post”> <input type=”checkbox” name=”checklist[]” value=”1″><label>Blue</label> <input type=”checkbox” name=”checklist[]” value=”2″><label>Red</label> … <input type=”submit” name=”submit” value=”submit”/> </form> <?php if(isset($_POST[‘submit’])){ if(!empty($_POST[‘checklist’])){ $selectArr = array(); foreach($_POST[‘checklist’] as $selected){ $selectedInt = (int)$selected; $selectArr[] = $selectedInt; wp_set_object_terms( $thePostId, $selectArr, ‘color’); } } } ?> where the values in input tags are taxonomies IDs … Read more

Restructuring permalink with more than one taxonomies

That’s quite possible by changing add_permstruct or filtering rewrite_rules. But what is your strategy for generating links for city? How will implement second taxonomy? I would go for implementing this as rewrite rule for something like add_filter( ‘rewrite_rules_array’, function( $rules ) { global $wp_rewrite; $new_rules = array( ‘(company|profession)/([^/]+)/([^/]+)/?$’ => ‘index.php?$matches[1]=$matches[2]&city=$matches[3]’ ); $rules = array_merge($new_rules, $rules); … Read more

List posts of custom post type under category name

Check this: $categories = get_categories( ‘country’ ); foreach ( $categories as $category ) { $posts_array = get_posts ( array ( ‘posts_per_page’ => -1, ‘post_type’ => ‘university’, ‘tax_query’ => array ( array( ‘taxonomy’ => ‘country’, ‘field’ => ‘term_id’, ‘terms’ => $category->term_id, ) ) ) ); var_dump( $posts_array ); } UPDATE: <div class=”container”> <div class=”row”> <ul class=”collapsible” … Read more