-
Notifications
You must be signed in to change notification settings - Fork 0
/
content-exhibition.php
48 lines (48 loc) · 1.53 KB
/
content-exhibition.php
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
<?php
$id = get_the_ID();
$start_date = get_field( 'start_date' );
$end_date = get_field( 'end_date' );
$institution = get_terms_str( $id, 'institution' );
$permalink = get_the_permalink();
$has_thumb = has_post_thumbnail( $id );
$block_classes = array( 'exhibition-block', 'block', 'exhibition', 'item', 'col', 'col-12', 'event' );
if( $has_thumb ):
array_push( $block_classes, 'col-sm-12', 'col-md-8', 'col-lg-6' );
else:
array_push( $block_classes, 'col-sm-6', 'col-md-4', 'col-lg-3' );
endif;
if( !get_field( 'images' ) ):
array_push( $row_classes, 'no-gallery' );
endif;
?>
<div data-id="<?= $id; ?>" data-post-type="exhibitions" <?php post_class( $block_classes ); ?>>
<a class="item-link" href="<?= $permalink; ?>">
<div class="row">
<?php if( $has_thumb ): ?>
<div class="col col-12 mobile">
<img class="block-thumb" src="<?= the_post_thumbnail_url( 'custom' ); ?>"/>
</div>
<div class="col col-12 col-sm-6 text">
<?php else: ?>
<div class="col col-12 text">
<?php endif; ?>
<?php if( $start_date ): ?>
<div class="dates">
<?= $start_date.' – '; ?>
<?php if( $end_date ): ?>
<?= $end_date ?>
<?php else: ?>
<?= 'Ongoing' ?>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="event-title"><?= get_the_title(); ?></div>
</div>
<?php if( $has_thumb ): ?>
<div class="col col-12 col-sm-6 desktop">
<div class="block-thumb" style="background-image:url(<?= the_post_thumbnail_url( 'custom' ); ?>)"></div>
</div>
<?php endif; ?>
</div>
</a>
</div>