Skip to content

Instantly share code, notes, and snippets.

@Swapnildhanrale
Created May 13, 2020 13:27
Show Gist options
  • Save Swapnildhanrale/80a497286b050cd3f2cb9809635c7384 to your computer and use it in GitHub Desktop.
Save Swapnildhanrale/80a497286b050cd3f2cb9809635c7384 to your computer and use it in GitHub Desktop.
To display multiple category on product archive page
add_filter('astra_woo_shop_product_categories' , 'category_callback');
function category_callback(){
$product_categories = function_exists( 'wc_get_product_category_list' ) ? wc_get_product_category_list( get_the_ID(), ',', '', '' ) : $product->get_categories( ',', '', '' );
$categories = !empty( $product_categories ) ? $product_categories : '' ;
return $categories;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment