Multiple taxonomies?
-
How to properly use the Multiple taxonomies. So that you can sort both by category and my own taxonomie.
<p>$term_slug = get_queried_object()->slug;</p> <p> if($term_slug=true){<br /> $args = array(<br /> 'post_type'=> 'wpcproduct',<br /> 'order' => 'ASC',<br /> 'orderby' => 'menu_order',<br /> 'posts_per_page' => $per_page,<br /> 'paged' => $paged,<br /> 'tax_query' => array(<br /> array(<br /> 'taxonomy' => 'wpccategories',<br /> 'field' => 'slug',<br /> 'terms' => get_queried_object()->slug<br /> )<br /> ));</p> <p> $args = array(<br /> 'post_type'=> 'wpcproduct',<br /> 'order' => 'ASC',<br /> 'orderby' => 'menu_order',<br /> 'posts_per_page' => $per_page,<br /> 'paged' => $paged,<br /> 'tax_query' => array(<br /> array(<br /> 'taxonomy' => 'marka',<br /> 'field' => 'slug',<br /> 'terms' => get_queried_object()->slug<br /> )<br /> ));</p> <p> }else{<br /> $args = array(<br /> 'post_type'=> 'wpcproduct',<br /> 'order' => 'ASC',<br /> //'orderby' => 'menu_order',</p> <p> 'posts_per_page' => $per_page,<br /> 'paged' => $paged,<br /> );<br /> }</p>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Multiple taxonomies?’ is closed to new replies.