Here is a guide on how to create a WooCommerce featured products loop of featured images. The featured product option is chosen from the star column in the WordPress dashboard backend of the WooCommerce products, ‘featured‘ it is a term that belongs to the taxonomy named ‘product_visibility‘.
This file contains hidden or 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
So in the above a shortcode is created; [woo_featured_products] ready to place anywhere on the site, the featured term is set in the taxonomy query and passed into the WP_Query arguments. The loop is output with just the featured image wrapped in the product page link.
This makes adding a featured Product Category unnecessary and makes is easier to change which products are output. You can cap the amount of products output by adjusting the post_per_page value.
I would like to add short description and a (custom) translatable button (with link to product) to this featured product shortcode. Button text need to be something like: “More about this product”. Is that possible? Thanks for your help and great blog posts!
1 comment
Bart
Hello Neil,
I would like to add short description and a (custom) translatable button (with link to product) to this featured product shortcode. Button text need to be something like: “More about this product”. Is that possible? Thanks for your help and great blog posts!
Kind Regards,
Bart