WordPress | Woocommerce | use “category display type” in if statement

Depending on where whoocommerce posts are stored, you could do this via basic WordPress post queries, via: $args = array( ‘post_type’ => ‘your_post_type’, ‘category_name’ => ‘your_category’, ‘tag’ => ‘your_tag’ ); $arr_posts = new WP_Query($args); if ($arr_posts->have_posts()) { while ($arr_posts->have_posts()) { echo $arr_posts->the_post(); // Echo out content of each post, but here you may do whatever … Read more

Conditional for product attribute page

This is the answer: function active_woocommerce_filters() { // for older WC versions // global $_chosen_attributes; $_chosen_attributes = WC_Query::get_layered_nav_chosen_attributes(); return count( $_chosen_attributes ); } https://stackoverflow.com/questions/33229238/woocommerce-check-if-filtering-products