Skip to content

Instantly share code, notes, and snippets.

@farookibrahim
Created May 24, 2019 07:12
Show Gist options
  • Save farookibrahim/7f14be5808335615897e7c9604063c82 to your computer and use it in GitHub Desktop.
Save farookibrahim/7f14be5808335615897e7c9604063c82 to your computer and use it in GitHub Desktop.
Electro display tags in archive
if ( ! function_exists( 'electro_template_loop_tags' ) ) {
/**
* Output Product Tags
*
*/
function electro_template_loop_tags() {
global $product;
$product_id = electro_wc_get_product_id( $product );
$tags = wc_get_product_tag_list( $product_id );
echo apply_filters( 'electro_template_loop_tags_html', wp_kses_post( sprintf( '<span class="loop-product-tags">%s</span>', $tags ) ) );
}
}
add_action( 'woocommerce_before_shop_loop_item_title', 'electro_template_loop_tags', 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment