Last active
July 25, 2020 09:22
-
-
Save jameshwartlopez/ec273a54052114c97af3958b4f392b4a to your computer and use it in GitHub Desktop.
Get 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 products by category. on this case its "shirts" which is the slug of the category. | |
$query_args = array( | |
'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