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.


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.


35.1 - 538,297
DreamHost

Scroll down for Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

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