Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Query Loop sort posts by date updated

  • I am trying to create a Latest post element which shows the latest 8 posts at the bottom of a post.

    I have used a Query loop grid

    I want to show the posts based on the last modified date in a descending order

    I DO NOT want to sort based on published date , as we keep on updating our posts

    I cant seem to display the latest modified post at the top in descending order.

    In the query loop settings, I tried to order by “Last modified date” but it is not working properly.

    You can see the “Latest Post” element in my admin panel

  • Hi there,

    I checked one post, but I did not see a GB query loop block.

    I saw the Read next section, is this what you referring to? If so, the block is not from GB, we do not have control over it.
    https://app.screencast.com/LMVMb2yaQbtRP

    Let me know if I miss anything!

  • Please login to my admin ( I have given the login details )

    Go to Elements>> Latest Post

    This is the block with query loop.

    I have sorted by Last modified

    https://imgur.com/jMUMCPr

  • Hi there,

    in the Query Loop add a Parameter: ORDER and set that to DESCENDING

  • I have set it as shown in screenshot

    https://imgur.com/UaHQt8c

    But it is not working properly

    see the posts at the bottom of the page

    https://www.smartbabyadvice.com/home/

    They are not showing last modified descending order

  • In your screenshot you have a Query Parameter of Post Status that has not value. Can you delete that parameter.

  • I removed it
    https://imgur.com/x15DgAr

    still not working properly

  • I changed the order by to “Date” and it is working fine now

    https://imgur.com/2SneY0O

  • Glad to hear that

  • Thanks

  • I am using the above Related post element on my Home page, but I want to use one on my Posts as well

    I want to ensure that the current post does not display in the list of related posts.

    I cant see how to do that?

    Do I need to build a different element for this? Or can I use the same one as I am using for my home page.

    Also should the Related posts grid show after or before the author box?

    How do I position these ( by Priority ?)

  • I want to ensure that the current post does not display in the list of related posts.

    It requires GB Pro plugin to add Exclude posts parameter and select the current post.

    Do I need to build a different element for this? Or can I use the same one as I am using for my home page.

    Which hook are you using? if you are happy with the hook on post, then you can use the same element, just add posts > all posts to the location along with your homepage.

    How do I position these ( by Priority ?)

    If they share the same hook, then yes, you can use priority to arrange the order.

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