-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-projects.php
64 lines (42 loc) · 1.32 KB
/
single-projects.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* The template for displaying project posts.
*
* @package mctc
*/
get_header(); ?>
<div class="wrapper">
<div class="project-wrapper">
<h1 class="project-title"><?php the_title(); ?></h1>
<div class="project-copy">
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; // end of the loop. ?>
</div>
<figure class="single-images-container">
<?php
if( have_rows('single_images_repeater') ):
while ( have_rows('single_images_repeater') ) : the_row(); ?>
<?php if( get_sub_field('image_section_header') ): ?>
<h2><?php the_sub_field('image_section_header'); ?></h2>
<?php endif; ?>
<div class="single-image">
<?php
$attachment_id = get_sub_field('single_image');
$medium_image = wp_get_attachment_image_src( $attachment_id, "medium" );
$full_image = wp_get_attachment_image_src( $attachment_id, "full" );
?>
<a href="<?php echo $full_image[0]; ?>"><img src="<?php echo $medium_image[0]; ?>" /></a>
<?php if( get_sub_field('single_caption') ): ?>
<figcaption><?php the_sub_field('single_caption'); ?></a></figcaption>
<?php endif; ?>
</div>
<?php endwhile;
else :
endif;
?>
</figure><!-- single-images-project -->
</div><!-- project-wrapper -->
<footer class="project-archive-nav"><a href="/?page_id=10">See all projects ></a></footer>
</div><!-- wrapper -->
<?php get_footer(); ?>