I have three different custom fields, for day (01-07) hour (01-12) and minute (00-59) and I really need to combine them into one custom value so I can actually order them using wp_query.
I cant actually just use custom field for the whole thing; it would be easier I know, but it needs to be easy on the user to input day/time. So that option is out of the question.
Is it possible to join those three numerical values for use in wp_query?
Thanks in advance for any help.
David
If you want to make it as easy as possible on the user, then I think the best option would be to add a custom meta box with three fields for inputting the day/hour/minute values. Using something like a jQuery UI slider style timepicker would further simplify input. Then when the post is saved, use the
save_post
action to store those three values in a single field.The second option is similar to the first, but you’d continue using the custom fields as you are now, except a fourth field would be added by you on the
save_post
action to combine them into a single field you use in your query.