WordPress Plugin: List category posts – Sort Order


Sort “List Category Posts” by Custom Field..

Normal use of the plugin “List Category Posts” would be date, or even title, but there is an option to use a custom field.

I created one today, for a site that needed posts ordered by an event date, no matter when they were actually posted

I created a Custom Field named ‘EventDate‘, where the date gets entered as ‘yyyy-mm-dd‘. eg: 2019-03-09

In the “List Category Posts” code for the page, the following was the code used instead of “orderby=date“:

  • customfield_orderby=EventDate order=desc

The default order is descending, but I left the “order=desc” in anyway.


101.1 - 873,703
Scroll down for Comments
0 0 votes
Article Rating
Subscribe
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x