Last active
December 7, 2023 21:46
-
-
Save kaskad88/fba279e0ebfa4dbf37f3462688e8af79 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
1) Add `random_users` CSS ID for Listing Grid widget https://tppr.me/7S5Xg | |
2) Add follow code to the functions.php file of child theme: | |
add_action( 'jet-engine/listing/grid/users-query-args', function( $args, $render ) { | |
if ( 'random_users' !== $render->get( '_element_id' ) ) { | |
return $args; | |
} | |
$args['orderby'] = 'rand'; | |
return $args; | |
}, 10, 2 ); | |
add_action( 'pre_user_query', function( $query ) { | |
if ( 'rand' === $query->query_vars["orderby"] ) { | |
$query->query_orderby = 'ORDER by RAND()'; | |
} | |
} ); |
👌, Thks
followed the advice here also used a simple user query and there is no random returns in the listing grid
@fbeach73 Could you please attach a screen or video of your steps ? Are you using the Query builder for user listing?
@kaskad88 Is it possible to work with Ajax, or the infinite scroll in jetengine?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@xtofr
Please check all the points I wrote above.
If again not successful, please contact our support https://crocoblock.com/help-center/ for guidance in resolving this issue (and mention that you were directed by me and reference this issue.)
thanks.