Display a random product thumbnail for a product category in WooCommerce
问题 I am trying to pull a random product thumbnail to display as an image on one of my pages. I can't seem to find a way that works, and have tried the solutions from this and this post. It would be beneficial to echo it out in a div as well. Here is what I am currently trying but I'm still unsure how to do this. functions.php: function get_random_thumbnails_for_reg(){ if(is_page(381)){ $args = array( 'tax_query' => array( array( 'taxonomy' => 'product_cat', 'field' => 'slug', 'terms' => 'allison