Created
January 17, 2018 10:03
-
-
Save madeincosmos/fdcbfe4f3345e1e7f7e0c889975d98e0 to your computer and use it in GitHub Desktop.
Add Product SKU on shop and category pages
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
function woocommerce_after_shop_loop_item_title_short_description() { | |
global $product; | |
if ( ! $product->get_sku() ) return; | |
?> <div itemprop="description"> | |
<?php echo apply_filters( 'woocommerce_short_description', $product->get_sku() ) ?> </div> | |
<?php | |
} | |
add_action('woocommerce_after_shop_loop_item_title', 'woocommerce_after_shop_loop_item_title_short_description', 5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment