i have a custom post type 'events'. Each event (post) can have multiple dates. The dates (date, time, location) are stored as array. I need a query that creates a chronological list of all events from the meta data (events can occur multiple times).
The custom-meta-box looks like this:
The resulting database entry in wp_postmeta has the meta_key
'_events_termine' with the following meta_value
(using WPAlchemy):
a:1:{s:12:"termin_group";a:2:{i:0;a:3:{s:11:"termin_date";s:10:"2011/03/14";s:11:"termin_time";s:5:"19.30";s:15:"termin_location";s:15:"Max-Reger-Halle";}i:1;a:3:{s:11:"termin_date";s:10:"2011/03/15";s:11:"termin_time";s:5:"20.00";s:15:"termin_location";s:15:"Max-Reger-Halle";}}}
I display the dates for a single event with the following code:
<table>
<?php global $events_meta_termine;
$meta = get_post_meta(get_the_ID(), $events_meta_termine->get_the_id(), TRUE);
foreach ($meta['termin_group'] as $termin)
{ ?>
<tr>
<td><?php echo mysql2date('D', $termin['termin_date'], true); ?></td>
<td><?php echo mysql2date('j. F Y', $termin['termin_date'], true); ?></td>
<td><?php echo $termin['termin_time']; ?> Uhr</td>
<td><?php echo $termin['termin_location']; ?></td>
</tr>
<?php } ?>
</table>
The output looks like this:
So everything works fine except i have no idea how to create a page that lists all events (title, date, location) in chronological order where a single event can occur several times.
Any help is highly appreciated!
(i'm sorry i asked a similar question before, but i came to a dead end and had to start over.)
$events_meta_termine
get its value exactly? Can you update the code in your question to show that?