This repository has been archived by the owner on Jul 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-events.php
36 lines (36 loc) · 1.57 KB
/
single-events.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
<?php get_header(); ?>
<section id="content">
<div class="flex-container">
<aside>
<h1><?php the_title(); ?></h1>
<?php $event_date = get_field('event_date'); ?>
<?php if ( $event_date ) : ?>
<div class="post__date">
<h6><?= $event_date ?></h6>
</div>
<?php endif; ?>
<?php $past_event = get_field('the_content_of_the_previous_event'); ?>
<?php if (!$past_event) : ?>
<div class="post__add-ics--left">
<a href="/wp-json/math/v1/events/?id=<?= get_the_ID(); ?>" class="btn"><?php esc_attr_e( 'Pridėti į kalendorių', 'math' ); ?></a>
</div>
<?php else : ?>
<div class="post__add-ics--left">
<a href="<?= $past_event['url']; ?>" class="btn btn--invert small" target="<?= $past_event['target']; ?>">
<?= $past_event['title']; ?>
</a>
</div>
<?php endif; ?>
</aside>
<main>
<?php $cover_img = wp_get_attachment_image(get_post_thumbnail_id($post->ID), 'full');?>
<?php if ($cover_img) : ?>
<div class="single-post__image">
<?= $cover_img; ?>
</div>
<?php endif; ?>
<?php the_content(); ?>
</main>
</div>
</section>
<?php get_footer(); ?>