Order by
The Order by field is a dropdown menu that lets you specify how to arrange the content in your grid. You can select options such as ID
, title
, date
, or custom fields that you have implemented.
Meta Key
If you wish to sort using a custom field, enter the appropriate key in the Meta Key field. First, choose either meta_value
or meta_value_num
from the Order by dropdown. The Meta Key is then set to the slug of your custom field.
meta_value
sorts content alphanumerically.meta_value_num
sorts it numerically.
For instance, if your custom field contains only numeric values, select meta_value_num
. Using custom fields can give you finer control over sorting, especially when the standard fields like title
, date
, or ID
are insufficient.
Tip: Consider adding a custom field, such as featured_order
, to your posts if you want to prioritise certain posts at the top of your grid. The Advanced Custom Fields plugin is a useful tool for incorporating custom fields into your posts.
Order
The Order field determines the sorting direction. The options available are ASC
(ascending) and DESC
(descending).
Additionally, you can enter RAND
to randomise the order of displayed posts. Note that RAND
will only randomise the posts visible on the current page, not the entire result set. If you use the Load More button, each new page will load a different set of random posts, potentially leading to duplicates. To mitigate this, you might configure your grid to display all results on a single page while using RAND
, as long as the total post count is manageable.