Forums › Forums › Search & Filter Pro › Is it possible to sort by month and then random?
Tagged: sort
- This topic has 3 replies, 2 voices, and was last updated 4 years ago by Trevor.
-
Anonymous(Private) November 10, 2020 at 5:56 pm #265879
On a website, I’m creating for a client, we have a long list of content being displayed using Search and Filter Pro. I would like these items to be sorted NOT by date, but by month and then randomly.
I’m not sure if this is possible… Please let me know if it is. Thanks!
Example
Post: November 8
Post: November 1
Post: November 5
Post: November 3
Post: November 5
Post: November 7
Post: November 8
Post: November 5
Post: November 3
Post: October 3
Post: October 5
Post: October 1
Post: October 30
Post: October 4
Post: October 28
Post: October 15
Post: October 14
Post: October 30
Post: October 2
Post: October 3
Post September 6
…..Trevor(Private) November 11, 2020 at 10:42 am #265997You can sort by month ONLY if you have a field with only the month in. In fact, you would likely want to sort by Year and Month, so the field would best have data in the format
YYYYMM
.Then, within the month, you want random. Yes, that would work. But, be warned. 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 the next pages. Each load of posts by infinite scroll is a ‘page’.
This is how WordPress does it, sorry. Random is something I would generally advise against using, unless you are showing all posts in a single page.
-
AuthorPosts