Categoría: BRICKS BRICKS/USERS/QUERY_VARS FILTERS FREE
-
Random Users Query Loop in Bricks
Looking to show users in random order when using a Users type of query in Bricks? Add the following in child theme‘s functions.php or a code snippets plugin: add_action( ‘pre_user_query’, function( $query ) { if ( $query->query_vars[‘orderby’] === ‘rand’) { $query->query_orderby = ‘ORDER BY RAND()’; } } ); add_filter( ‘bricks/users/query_vars’, function( $query_vars, $settings, $element_id )…