Forums › Forums › Search & Filter Pro › Order of options
- This topic has 3 replies, 3 voices, and was last updated 5 years, 8 months ago by
Anonymous.
Viewing 4 posts – 1 through 4 (of 4 total)
-
Trevor(Private) November 3, 2020 at 11:40 am #265026
It somewhat depends on the Display Results method you are using. We do offer the option to sort posts randomly, but the ‘random’ order that WordPress provides (which is what we use) is PER PAGE of results, thus some posts may (and likely will) be repeated on many pages. Each load of posts by infinite scroll is a ‘page’.
This is how WordPress does it, sorry.
In short, I would advise against it.
Anonymous(Private) January 11, 2021 at 11:28 am #272318You can achieve something close with this snippet in your functions.php, although the randomized order persists between sessions rather than visits. Source
session_start(); add_filter('posts_orderby', 'edit_posts_orderby'); function edit_posts_orderby($orderby_statement) { $seed = $_SESSION['seed']; if (empty($seed)) { $seed = rand(); $_SESSION['seed'] = $seed; } $orderby_statement = 'RAND('.$seed.')'; return $orderby_statement; } -
AuthorPosts
Viewing 4 posts – 1 through 4 (of 4 total)