-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmpl-schedule.php
More file actions
54 lines (50 loc) · 1.89 KB
/
tmpl-schedule.php
File metadata and controls
54 lines (50 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* Template Name: Schedule
*/
?>
<?php get_template_part('templates/schedule', 'header'); ?>
<?php
$args = array(
'post_type' => 'event',
'posts_per_page' => -1,
'meta_query' => array(
'relation'=>'AND',
array('key' => 'starts', 'compare' => '>=', 'value' => date('Y-m-d'), type => 'DATE' )
)
);
$the_events = new WP_Query( $args );
?>
<section class="ps thetimetable">
<div class="row">
<div class="columns large-10 large-centered">
<div class="schedule schedule--all">
<div class="aday aday--nopad">
<?php if (get_field('schimage')) :?>
<?php $schimage = get_field('schimage'); ?>
<img src="<?php echo $schimage['url']; ?>" alt="<?php echo $schimage['alt']; ?>" />
<?php else: ?>
<img src="<?= get_template_directory_uri().'/dist/images/orarend.jpg' ?> " alt="Órarend áttekintő">
<?php endif; ?>
</div>
<?php $prevday=''; ?>
<?php while ($the_events->have_posts()) : $the_events->the_post(); ?>
<?php
$thisday = date_i18n('F d.', strtotime(get_field('starts')));
$nameoftheday = date_i18n('l', strtotime(get_field('starts')));
?>
<?php if ( ($prevday!='') && ($thisday != $prevday) ) : ?></div></div><?php endif; ?>
<?php if ( $thisday != $prevday ) : ?>
<div class="aday">
<h3 class="aday__title">
<?= $nameoftheday ?> <small><?= $prevday=$thisday; ?></small>
</h3>
<div class="calendar calendar--day">
<?php endif; ?>
<?php get_template_part('templates/calendar','entry'); ?>
<?php endwhile; ?>
<?php if ( ($thisday == $prevday) ) : ?></div></div><?php endif; ?>
</div>
</div>
</div>
</section>