Guest User

Untitled

a guest
Jan 20th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. // WOOCOMMERCE TAGS
  2. // Tag in archive pages//
  3. add_action( 'woocommerce_shop_loop_item_title', 'woocommerce_product_loop_tags', 5 );
  4. // Tag on singel productpage
  5. add_action( 'woocommerce_before_single_product_summary', 'woocommerce_product_loop_tags', 5 );
  6. function woocommerce_product_loop_tags() {
  7. global $post, $product;
  8.  
  9. $tag_count = sizeof( get_the_terms( $post->ID, 'product_tag' ) );
  10. // echo $product->get_tags( ', ', '<span class="tagged_as">' . _n( 'Tag:', 'Tags:', $tag_count, 'woocommerce' ) . ' ', '</span>' );
  11. echo $product->get_tags( ', ', '<span class="tagged_as">' . _n( '', '', $tag_count, 'woocommerce' ) . ' ', '</span>' );
  12. }
Add Comment
Please, Sign In to add comment