I would to get in a <li>
list all sku there are in an ecommerce.
I belive that I should use foreach
cycle, but I don't know how to recall the selection of all products.
Thanks for all reply, and sorry for my bad english. Greatings
I would to get in a <li>
list all sku there are in an ecommerce.
I belive that I should use foreach
cycle, but I don't know how to recall the selection of all products.
Thanks for all reply, and sorry for my bad english. Greatings
Please try this. Let me know if this works perfectly ;)
Cheers!
Never, ever use
query_posts
. It is only for the main query loop and should never be modified. There are many, many other ways of grabbing the posts you want. For example:It's worth noting that this method will only fetch simple products, and will not include product variations. If you want to grab those too, you'll need to update the
$args
to'post_type' => array('product', 'product_variation')
.