[Resolved] How do i sort posts by a custom field?
OK, part of my website (centrumok.se) has posts showing events coming up soon. They are sorted so that the event that coming up in nearest time is shown first at the top etc.
Right now these posts are ordered by publishing date which means I have to change the publishing date for a post if I am putting in a new event within all the others.
So I decided to have custom fields for the date of the event so I could order the posts by the date taken from the custom field, but it doesn’t work with plain ol’ get_posts since there is no orderby a certain custom field.
Does anyone have an idea of how to make this work? How do I make this query so that it gets ordered by the custom field?
- The topic ‘[Resolved] How do i sort posts by a custom field?’ is closed to new replies.