Created
July 3, 2015 22:48
-
-
Save bekarice/fdb6f261f53f4c0dbcac to your computer and use it in GitHub Desktop.
Adds a "Featured" flash to featured WooCommerce products (like a sale flash)
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 wc_add_featured_product_flash() { | |
global $product; | |
if ( $product->is_featured() ) { | |
echo '<span class="onsale">Featured</span>'; | |
} | |
} | |
add_action( 'woocommerce_before_shop_loop_item_title', 'wc_add_featured_product_flash' ); | |
add_action( 'woocommerce_before_single_product_summary', 'wc_add_featured_product_flash' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment