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 6 months, 1 week ago.

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

    jamesparkin
    Participant
    Post count: 5

    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.

  • https://gist.github.com/anonymous/242ec351bfa50ad511e2
  • 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.

#105719

Sridhar Katakam
Participant
Post count: 1068

Go to http://www.billerickson.net/customize-the-wordpress-query/, 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.