Wordpress site build on Bedrock needs template adjustment. Events displayed in the template are sorted from the oldest to the newest. I assume this is default behavior, as I can't see any specific part responsible for sorting.
I would like to sort events from the newest to the oldest.
Code in the template for displaying events:
<list-posts
:list="{{ $past_events }}"
api-url="/wp-json/version/past-events"
>
<template v-slot:default="{ list }">
<event-card
v-for="event in list"
:key="event.id"
:event="event"
type="overview"
>
I tried to add different sorting command to the end of "wp-json..." path:
?filter[orderby]=date&order=desc
?filter[orderby]=event_date&order=desc
?orderby=date&order=desc
but they break the site (each line used separately).
I would appreciate any hint on how to correctly sort events (newest to oldest).
question from:
https://stackoverflow.com/questions/65866128/sorting-events-in-wordpress-bedrock-template 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…