Just an idea: you could save your time values in an array and then sort it with PHP.
Example:
$keys = array('opening_time', 'film_time', 'artist_talk_time');
$times = array();
$custom_field_keys = get_post_custom_keys();
foreach ($custom_field_keys as $custom_field_key) {
if (in_array($custom_field_key, $keys) {
$custom_field_value = get_post_meta($post->ID, $custom_field_key, true);
if ($custom_field_value >= $thedate && $custom_field_value <= $future) {
$counttest++;
$times[$custom_field_key] = $custom_field_value;
}
}
}
asort($times);
foreach ($times as $time_key => $time_value) {
if ($time_key == 'opening_time') {
...
}
else if ($time_key == 'film_time') {
...
}
...
}
Related Posts:
- How to set a custom post type to have viewable future posts
- Loading Custom Post Type Events into jQuery-based FullCalendar?
- sort events based on event date custom field
- 1 day after custom date change post status to draft
- Custom Post Type Events Archive Grouped By Month
- Save metadata as a timestamp, display as a “pretty” date
- Display upcoming Events for next 7 Days
- CPT EVENT – listing by month and filtering by category and month – form select option
- Creating a Custom Post Type and Joining with Users
- Select event where start date is smaller than current date and end date is greater than current date
- List of all entries of custom-post-type: Add year-parameter?
- Sort custom post type by most current date picker
- Should i use a plugin for Event Manager or code my own needs? [closed]
- the ‘save_post’ event triggers when I want to start a new post
- Empty meta-box returns publishdate if no value is set?
- Event Archive by Month
- how to compare different timestamps in wp-query for events custom post types?
- Creating an Events Feed with Sub Pages/Posts for Each Event
- Yelp-style geographic directory plugin?
- How do I list the next 7 days and any events (cpt) contained in those days
- Custom Post Type ‘Event’: Chronological list of recurring events from meta_values in array
- connect users to Custom post types
- Query events post type after current date and timezone
- Loop posts in a table ordered by a custom field value
- Custom Loop Event Page
- Add role privileges of the custom post type
- Events with multiple event dates + permalink for each date
- Query Event Posts by Date
- Listing future posts together with normal posts
- Count of posts with meta_key filled in?
- How to print different informations for different post types inside The Loop?
- What would be the optimal CPT / Taxonomy design for the following entities structure
- How to connect different CPTs together?
- How To Remove These Stuffs From Custom Post Type List Screen?
- Exclude a category from WP_Query
- Check if post type has term
- Setting up custom post type archives in WP3.1? Any luck?
- Query custom post type by custom field
- WordPress custom taxonomy URL rewrite on spelling errors
- Include post id[s] into WP_Query()
- TV Show database – Best way for structuring it?
- Defining a default page for custom post type
- Using Offset in Custom Post Type Query
- How to let custom post type posts show in standard post archive (like in homepage)?
- remove post-name from title in custom post type
- Custom Post Type single and archive pages are not working
- Add Taxonomy Values Within a Custom Post Type RSS Feed
- Query in a Hierarchical Custom Post Type for Children vs Siblings
- Pagination Issue: Custom Post Type In Index
- removing custom tax & CPT slug, adding taxonomy term in front of custom type
- Why is WordPress custom post type not showing in admin panel?
- Issue with pre_get_posts on custom post type archive pages
- Add html to cpt main page / admin edit.php
- Copy custom field value to post title
- How to show cutom post labels in options?
- Sorting Custom Post Type by Meta Value but wont display when set to 0
- Can I list a custom post type within another custom post type in the admin area?
- wordpress wp_list_pages help
- How to display custom taxonomies with links in filter menu?
- List custom taxonomy specific to one custom post type
- Rows with custom columns not well formatted after Quick Edit save
- Show child custom post types list inside single parent custom post type
- Create Connection Between two post types
- A case for Hierarchical Custom Posts
- Custom title set on quick edit
- Filter Posts from the Main Query
- WordPress Custom Search by post_type
- Custom post type Permalinks with hierarchical Taxonomies
- Enable taxonomies by post type in an array of CPTs
- Slug for custom post type
- Hide specific taxonomies from a taxonomy list using ‘get_object_taxonomies’
- How does the ‘the_post_navigation()’ work for CPT’s?
- Display post from a date range from custom field
- Stores category posts in an array
- How to define the template for custom posts?
- Add post type pages with plugin
- Multiple archives to display parent and subcategories content
- Passing variables through permalink structure in custom post types
- Displaying custom post type listing
- Extend Custom Post Type
- Do stuff when editing or writing a certain custom post type?
- Url Rewriting a dynamic wordpress page with parameters
- Display list of Custom Post
- php dynamic content inside shortcode
- Can’t save meta box data in WordPress using custom post types
- Adding Post Title from custom post type to another custom post type
- How to merge 2 custom post type permalinks
- Display post with specific role
- How to use multiple orderby conditions on query search results? (orderby one post type, relevance)
- Categories manage
- Adding Custom Post Types to category/tag/author archives breaks header content
- Filtering custom post using Ajax and taxonomies, keep getting 0
- custom post permalink
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- Custom metabox fields not saving when limited to a certain CPT
- Displaying database table in backend of wordpress
- Query Custom Post Type by Tag
- Loops running into each other
- Permalinks Works for Custompost type but not with pages Why?
- Rewriting hierarchical post type