-
Bernhard
Hello,
I am looking for documentation on query parameters. In particular, I would like to know how theorder by
menu item
parameter works.
Thank you -
Alvind
Hi there,
The Query Loop uses the
WP_Query()
class, so all parameters in the block follow the class’s parameters. You can find detailed documentation on the official WordPress documentation site here:
https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters -
Bernhard
Hi Alvind,
I understand.menu_item
is not very practical for me. Is it possible to sort for a custom field, ascending or descending? I would like to order for a date, e.g. in the format240726
for today July 26,240727
for tomorrow and so on -
Bernhard
OK, I figured it out by combining the snippet you gave me here with the wordpress documentation. 🙂
Thank you very much -
Alvind
You’re welcome, glad to hear that!
- You must be logged in to reply to this topic.