WooCommerce – Get featured products IDs

Remi | August 29, 2013 | in Tutorials

And another great snippet that i coded today. It’s a function that creates an array of featured products IDs. That’s pretty useful if for example you want to quickly get only featured products IDs, or doing a condition (if has featured product then do that…). The function store all featured products IDs within a transient to avoid unwanted connections to the database. Simply place that code within your functions.php file:

The author

About the author Remi: Hey! My name is RĂ©mi Corson, I'm a French WordPress Developer, I code stuff and I write from time to time ;-)

Leave a reply