Created
February 15, 2016 11:56
-
-
Save mikejolley/57034501e74ff552dce9 to your computer and use it in GitHub Desktop.
Show category name in shop loops
This file contains hidden or 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
// code added to theme functions.php file | |
add_action( 'woocommerce_after_shop_loop_item', 'show_product_category_name' ); | |
function show_product_category_name() { | |
global $post; | |
echo get_the_term_list( $post->ID, 'product_cat' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment