• Is it possible to order posts in the order of a custom field?

    I want to create my own events listing, with members of my site adding events. They will be adding the date to a custom field (via Gravity Forms), so it would be good to order in this way, with the most recent coming first.

    Also, is there a way to automatically remove posts after that date?

Viewing 2 replies - 1 through 2 (of 2 total)
  • It is possible, using the ‘meta_key=keyname’ and ‘orderby=meta_key’as explained in the Codex Orderby Parameters.

    The date will need to be in a ‘sortable’ format: yyyymmdd. If someone enters a date with an incorrect format, it will mess up the sort order.

    I don’t know about the automatic removal.

    Thread Starter HorrorUK

    (@horroruk)

    Thanks, it’s something to get working on.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Order posts by date in a custom field?’ is closed to new replies.