• Resolved maguijo

    (@maguijo)


    I can’t find where this question has been answered, so I’m asking here. Apologies if the information is somewhere and I missed it!

    If I’m using a query loop type block (GenerateBlocks Query Looper for example) in order to show the next 3 upcoming events, the events are coming in ordered by publish date. I need to add an Order By parameter so they can be ordered by event start date (and the event start date has to be after today’s date). How can I do that with Pie Calendar events?

    Or, is there another way to show the next 3 upcoming events in a block on a non-event page?

Viewing 1 replies (of 1 total)
  • Plugin Author Spellhammer

    (@spellhammer)

    Hey @maguijo,

    Pie Calendar stores its dates in the meta key _piecal_start_date.

    You’ll probably need to use the meta_key and orderby arguments in your query to sort the results based on this key’s value. You can find some examples here: https://developer.ww.wp.xz.cn/reference/classes/wp_query/.

    To exclude events where _piecal_start_date is before today’s date, you’ll need to employ a meta query I believe. I’m not sure if GenerateBlocks Query Looper supports that or not, so you may need to check with them on how to implement that.

Viewing 1 replies (of 1 total)

The topic ‘Order by Event Date in Query Loop block’ is closed to new replies.