items.php 935 Bytes
Newer Older
Benthe Kuijpers's avatar
Benthe Kuijpers committed
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
<?php
$layout = get_sub_field('layout');
?>
<div class="content-row items-row items-row--<?php echo $layout; ?>">
	<div class="container">
		<h3><?php the_sub_field('title'); ?></h3>
		<?php
		if (have_rows('items')) : ?>
			<div class="grid grid--medium">
				<?php while (have_rows('items')) : the_row(); ?>
					<div class="item">
						<?php
						$image = get_sub_field('img');
						if( $image ) {
							echo wp_get_attachment_image( $image, 'medium-square' );
						} ?>
						<div class="item__content">
							<h3><?php the_sub_field('title'); ?></h3>
							<?php the_sub_field('description');
							$link = get_sub_field('text_link');
							$url = get_sub_field('text_link_url');
							if ($link && $url) {
								echo '<a href="' . $url . '" target="_blank" class="text-link text-link--external">' . $link . '</a>';
							} ?>
						</div>
					</div>
				<?php endwhile; ?>
			</div>
		<?php endif; ?>
	</div>
</div>