WordPress Plugin: List category posts – Sort Order

ai2

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.


These Adverts help to pay for this site.

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.


37.1 - 553,505
DreamHost

Scroll down for Comments
0 0 vote
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