daily pastebin goal
90%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top