WooCommerce New Product Badge
A very simple plugin that displays a ‘new’ badge on products that were published in the last x days. X is defined on the catalog tab of the WooCommerce settings screen. Please feel free to contribute on github .
A very simple plugin that displays a ‘new’ badge on products that were published in the last x days. X is defined on the catalog tab of the WooCommerce settings screen.
Please feel free to contribute on github .
A closer look.
- 01Upload woocommerce-new-product-badge to the /wp-content/plugins/ directory
- 02Activate the plugin through the ‘Plugins’ menu in WordPress
- 03Define how ‘new’ products must be (in days) to receive the ‘new’ badge on the catalog tab of the WooCommerce settings screen.
- 04Done!
Frequently asked questions.
Installation Instructions
Upload woocommerce-new-product-badge to the /wp-content/plugins/ directory Activate the plugin through the ‘Plugins’ menu in WordPress Define how ‘new’ products must be (in days) to receive the ‘new’ badge on the catalog tab of the WooCommerce settings screen. Done!
I want to style the badge myself, how do I remove the default styles
There are only a couple of styles applied to the badge. Although not best practise it’s probably safe to just overwrite these with your own css. However, if you want to do it properly you can either dequeue the css:
add_action( 'wp_enqueue_scripts', 'remove_new_badge_styles', 30 ); function remove_new_badge_styles() { wp_dequeue_style( 'nb-styles' ); }
Or use the filter:
add_filter( 'woocommerce_new_badge_enqueue_styles', 'remove_new_badge_styles' ); function remove_new_badge_styles() { return false; }