-
-
Save cagartner/3ce7de883e15e5ce990134669be76fef to your computer and use it in GitHub Desktop.
WooCommerce - Make related posts randomly
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
<?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