Is it possible to define the data type of a Custom Field?

Hia.

Basically no. But, you can order by meta_value in WP_Query, so you can sort. I am not sure what format you are storing the dates as, but it will need to be something that MySQL can order by, a simple Unix timestamp would be fine, you would do:

$query = new WP_Query( 'post_type=seminar&meta_key=start_time&meta_value=" . time() .  "&meta_compare=>' );

Would get all the seminars with a start date after “now”

Leave a Comment