php - How to orderby woocommerce product categories as in the order I want? -
this query arguments. want products appear according categories arranged in order want.
$query_args = array( 'post_type' => 'product', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => $post_per_page, 'orderby' => 'name', 'order' => 'desc', 'paged' => $paged, 'tax_query' => array( array('taxonomy' => 'product_cat', 'field' => 'term_id', 'terms' => 12, 'operator' => 'not in', ) ) ); $wp_query = new wp_query($query_args);
means, want specify category order in query somewhere..
array(3,4,5,7)
and products category 3 appear first, 4, 5 , on. how can achieve this? tried plugin, seems it's not working custom query. https://wordpress.org/plugins/taxonomy-terms-order/
- just go under appearance->widgets
- list item under sidebar added woocommerce product categories expand "woocommerce product categories"
- list item @ order dropdown box choose "category order" instead of name.
Comments
Post a Comment