single.php 1.12 KB
Newer Older
1
2
<?php get_header(); ?>

3
	<main id="primary" class="site-main page--news">
4

Benthe Kuijpers's avatar
Benthe Kuijpers committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
		<div class="single__content">
			<?php
			while ( have_posts() ) :
				the_post();

				if (has_post_thumbnail()) { ?>
					<div class="single__image"><?php echo get_the_post_thumbnail($post, 'large'); ?></div>
				<?php } ?>

				<div class="container container--small">

					<?php $categories = get_the_category(); ?>
					
					<?php if (!empty($categories)) {
						$cat_string = join(', ', wp_list_pluck($categories, 'name'));
						echo '<span class="label">' . $cat_string . '</span>';
					} ?>

					<h1><?php the_title(); ?></h1>
					<?php the_content(); ?>

					<div class="single__button">
Benthe Kuijpers's avatar
Benthe Kuijpers committed
27
						<?php if (is_singular('events')) { ?>
28
							<a href="<?php echo get_post_type_archive_link('events'); ?>" class="btn btn--back"><?php _e('see all events', 'makeitopen'); ?></a>
Benthe Kuijpers's avatar
Benthe Kuijpers committed
29
						<?php } else { ?>
30
							<a href="<?php echo get_permalink(get_option('page_for_posts')); ?>" class="btn btn--back"><?php _e('see all news', 'makeitopen'); ?></a>
Benthe Kuijpers's avatar
Benthe Kuijpers committed
31
						<?php } ?>
Benthe Kuijpers's avatar
Benthe Kuijpers committed
32
33
34
35
36
37
					</div>

				</div>

			<?php endwhile; ?>

38
		</div>
39
40
41
42

	</main>

<?php get_footer(); ?>