Support » Plugins » Date sorting in Verve Meta Boxes

Viewing 2 replies - 1 through 2 (of 2 total)
  • I am struggling with this to. We need to do a meta_compare against the current time in the query. For past dates, it would be something like this.

    query('showposts=20&post_type=show&meta_key=date&orderby=meta_value&meta_compare=<=&meta_value=' . time() . '&order=DESC' );

    its not working, i think, because the way that Verve saves dates. The date needs strtotime() to convert it but I’m not sure how to go about doing that within a query. If you haven’t solved this, try this plugin: it works but the interface for setting the date on the backend is not as client-friendly as Verve’s.

    Let me know if you found a solution for Verve.

    ok, that was kind of easy once I articulated the problem. This should achieve what you want:

    query('&meta_key=date&orderby=meta_value&meta_compare=<=&meta_value=' . date("Y-m-d H:i:s", time()) . '&order=DESC' )

    just change meta_key=date to meta_key=“your verve meta box key”

    this function will show expired events, change the ‘<‘ to ‘>’ for upcoming events.


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Date sorting in Verve Meta Boxes’ is closed to new replies.