Created
September 14, 2012 10:26
-
-
Save maor/3721197 to your computer and use it in GitHub Desktop.
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
add_action( 'pre_get_posts', 'mc_modify_query_rand_posts' ); | |
function mc_modify_query_rand_posts( $query ) { | |
if ( ! is_admin() && $query->is_main_query() ) | |
$query->set( 'orderby', 'rand' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment