pinned_content_grid.php 1.72 KB
Newer Older
Benthe Kuijpers's avatar
Benthe Kuijpers committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<div class="content-row pinned-content">
		<div class="container">
		<div class="flex-grid">

			<div class="news-wrapper">
				<h3><?php _e('latest news', 'makeitopen'); ?></h3>
				<div class="grid">
					<?php
					$news_items = get_sub_field('news');

					foreach ($news_items as $news) {
						$news_post = get_post($news);
						include(locate_template('template-parts/elements/news-teaser.php'));
					} ?>
				</div>
alain's avatar
alain committed
16
				<a href="<?php echo get_permalink(get_option('page_for_posts')); ?>" class="btn btn--red"><?php _e('see all news', 'makeitopen'); ?></a>
Benthe Kuijpers's avatar
Benthe Kuijpers committed
17
18
19
			</div>

			<div class="flex-grid">
20
21
22
23
24
25
26
27
28
29
30
				<?php
				$event_items = get_sub_field('events');
				if (!empty($event_items)) { ?> 
					<div class="events-wrapper">
						<h3><?php _e('events', 'makeitopen'); ?></h3>

						<?php
						foreach ($event_items as $event) {
							$event_post = get_post($event);
							include(locate_template('template-parts/elements/events-teaser.php'));
						} ?>
alain's avatar
alain committed
31
						<!-- <a href="<?php echo get_post_type_archive_link('events'); ?>" class="text-link"><?php _e('go to full agenda', 'makeitopen'); ?></a> -->
32
33
					</div>
				<?php } ?>
Benthe Kuijpers's avatar
Benthe Kuijpers committed
34
35
36
37
38
39
40

				<div class="resources-wrapper">
					<h3><?php _e('resources', 'makeitopen'); ?></h3>
					<?php
					$resource_items = get_sub_field('resources');

					foreach ($resource_items as $resource) {
Benthe Kuijpers's avatar
Benthe Kuijpers committed
41
						$filterclass = '';
Benthe Kuijpers's avatar
Benthe Kuijpers committed
42
						$resource_post = get_post($resource);
Benthe Kuijpers's avatar
Benthe Kuijpers committed
43
						$resource_filters = get_the_terms($resource_post, 'resource-types' );
Benthe Kuijpers's avatar
Benthe Kuijpers committed
44
45
						include(locate_template('template-parts/elements/resource-teaser.php'));
					} ?>
alain's avatar
alain committed
46
					<a href="<?php echo get_post_type_archive_link('resources'); ?>" class="btn btn--green"><?php _e('see all resources', 'makeitopen'); ?></a>
Benthe Kuijpers's avatar
Benthe Kuijpers committed
47
48
49
50
51
				</div>
			</div>
		</div>
	</div>
</div>