I need wrap date and all events in one day to div "obal_date" but this not work. The number of events may be different, but I need wrap date + all events. Please how can I do that. Thank you very much.
<?php
# This will hold what group we're in
$current_header = '';
# The Loop
while ( $the_query->have_posts() ) :
$the_query->the_post();
$temp_date = get_post_meta( get_the_ID(), 'datum_eventu', true );
echo '<div class="obal_over">';
if ( $temp_date != $current_header ) {
$current_header = $temp_date;
/*****************output date******************/
?>
<div class="obal_date">
<?php
echo "<span class='date'>".date("d", strtotime($current_header))."</span>";
echo "<span class='month'>".date("M", strtotime($current_header))."</span>";
?>
</div>
<?php
/*****************date end******************/
}
/*****************All event action1, action2....******************/
$title = get_post_meta( get_the_ID(), 'nazev_eventu', true );
$cas = get_post_meta( get_the_ID(), 'cas_eventu', true );
echo '<div class="obal_single">';
echo "<span class='cas'>".$cas."</span>";
echo "<span class='title'>".$title."</span>";
echo '</div>';
echo '</div>';
/*****************End event action1, action2....******************/
endwhile;
?>
EDIT1:
I need get:
div -> date -> action1 -> action2 -> /div
<div class="obal_over">
<div class="obal_date">
01Sep
</div>
<div class="obal_single">City1 title</div>
<div class="obal_single">City1 title2</div>
<div class="obal_single">City3 title</div>
</div>
//..... other date and action again start class="obal_over"
But I get
div -> date -> action -> /div -> div -> action2 -> /div
<div class="obal_over">
<div class="obal_date">
01Sep
</div>
<div class="obal_single">City1 title</div>
</div>
<div class="obal_over">
<div class="obal_single">City1 title2</div>
</div>
<div class="obal_over">
<div class="obal_single">City3 title</div>
</div>