Forums Forums Search & Filter Pro Is it possible to sort by month and then random?

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Anonymous
    #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
    #265997

    You 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.

    Anonymous
    #266066

    Thanks Trevor! I think that will work. I’ll test it out.

    Trevor
    #266074

    OK. Do let me know how you get on?

Viewing 4 posts - 1 through 4 (of 4 total)