Created
May 13, 2020 13:27
-
-
Save Swapnildhanrale/80a497286b050cd3f2cb9809635c7384 to your computer and use it in GitHub Desktop.
To display multiple category on product archive page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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