Last active
July 18, 2016 03:15
-
-
Save claudiosanches/da112ab9a88e79a1e947 to your computer and use it in GitHub Desktop.
WooCommerce - Make related posts randomly
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 | |
function rand_related_products_query( $query ) { | |
$query['limits'] = ' ORDER BY RAND() ' . $query['limits']; | |
return $query; | |
} | |
add_filter( 'woocommerce_product_related_posts_query', 'rand_related_products_query' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment