Sorting in a View

Support MB Views Sorting in a View

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #35664
    LufruttaLufrutta
    Participant

    Is it possible to make a certain sorting within a view?
    The loop {% for post in query.posts %} shows the posts sorted by ID in descending order. I'd like to have a random order.

    Many thanks in advance
    Wilfried

    #35668
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Please follow this documentation to create a custom query https://docs.metabox.io/extensions/mb-views/#custom-query
    you can pass the argument sort to the function get_posts() to sort the posts.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.