• Resolved Bert O

    (@websitehelperberto)


    Trying to order posts by a custom field.

    wp_show_posts id="63" settings="meta_key=expiry_date&orderby=meta_value&order=ASC

    The output of the custom field (expiry_date) for example is in this format 2019-11-09 00:00:00 (date of expiry, time of expiry).

    The posts are not quite showing in the order they should, for instance, there are posts that expire sometime in 2020 showing and they should not be displaying ahead of all 2019 posts. Some months are not in order either, I have October, November, October, December and the some October posts.

    • This topic was modified 6 years, 7 months ago by Bert O. Reason: Custom field, not custom post type

The topic ‘Order Posts By Custom Field’ is closed to new replies.