I have a WooCommerce site where products are considered as trade/deal. Therefore, when someone take a trade (buy a product), it become out of stock.
How to display the number of products that has been published today (the new ones)?
ex: 4 New Trades (products) Published Today
The custom function below will return with a SQL query the newly published products count (maid in the 24 hours):
Code goes in function.php file of your active child theme (or theme) or also in any plugin file.
Tested and working
Usage example (in any php file):
will display something like: