Hello,
I would like to show on my page task manager-callendar.
It has stucture.
Post type: event
wordpress field : title
wordpress field : content
wordpress field : thumbnail
acf checkbox : week ( range 1-5)
acf checkbox : day ( range monday – sunday)
acf checkbox : hour (range 0:00 – 12:00)
Each post can have few checkboxes marked. example week 1, week 4, monday, thursday, 3:00, 5:00, 8:00.
It should be presented like this.
week1
monday
3:00 title post 1
5:00 title post 1
8:00 title post 1
10:00 title post 4
11:00 title post 6
thursday
3:00 title post 1
5:00 title post 1
8:00 title post 1
10:00 title post 4
11:00 title post 8
week4
monday
3:00 title post 1
5:00 title post 1
8:00 title post 1
10:00 title post 4
11:00 title post 5
thursday
3:00 title post 1
5:00 title post 1
8:00 title post 1
10:00 title post 4
11:00 title post 5
Each week is a div and day of this week will be new div inside week div.
like this
<div class="week">
<h2>Week4</h2>
<div class="day">
<h3>monday</h3>
<ul class="post-titles">
<li>3:00 title post 1</li>
<li>5:00 title post 1</li>
<li>8:00 title post 1</li>
<li>10:00 title post 5</li>
<li>11:00 title post 8</li>
</ul>
</div>
</div>
I use this structure to find this specific post type but I don’t know how to loop through them and present
<?php
$events = new WP_Query(array(
'posts_per_page' => -1,
'post_type' => 'event',
));
if ($events->have_posts()) {
while($events->have_posts()) {
$events->the_post();
}
}
?>