Last active
July 25, 2020 09:21
-
-
Save jameshwartlopez/e6b195c810196295e91fcf44cfe807fd to your computer and use it in GitHub Desktop.
Get featured products by category. See https://jameshwartlopez.com/plugin/get-featured-products-of-a-category/
This file contains 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
<?php | |
// Get featured products by category. on this case its "shirts" which is the slug of the category. | |
$query_args = array( | |
'featured' => true, | |
'category' => array( 'shirts' ), | |
); | |
$products = wc_get_products( $query_args ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment