Add ‘New’ badge for recently added items

This code puts a ‘New!‘ badge on items that have been added recently. The setting in the example below is for products added in the last 30 days. A class has also been included to match the “onsale” button, but you can change the class name if you want to style it differently.