sort posts by meta value

Community Forums Forums General Discussion sort posts by meta value

This topic is: not resolved

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  Sridhar Katakam 1 year, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #105635


    I recently tried using the Post Expirator plugin which worked great. Then I tried using the follow code to sort all posts by ASC order according to the expiry date, . but this just displayed by the order which I had posted them.

  • But If I made a custom field called start-date and value of YYYY-MM-DD, how would I call the query in the function.php file, to display posts in order that they occur? This is in multiple categories with subcategories.

    Example: Event #1 June 01 2014
    Event #2 Dec 17 2014

    Many thanks to those who can help. Been trying to get this to work for awhile.


Sridhar Katakam

Go to, scroll down to “Modify Query based on Post Meta” and use that code (modify to your needs).

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

You must be logged in to reply to this topic.