-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsingle-projects.php
65 lines (54 loc) · 1.9 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
65
<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post();
$terms = get_the_terms( $post->ID, 'type');
$count = count( $terms );
$i = 0;
$active = "active";
$types = '';
$klasses = '';
foreach( ( $terms ) as $cat ) {
$i++;
$klasses .= $cat->slug . ' ';
if ( $cat->slug !== 'case-study' ) {
$types .= $cat->name;
if ( $i < $count ) {
$types .= " + ";
}
}
}
?>
<article <?php post_class($klasses) ?>>
<?php
if(get_field('slide')):
?>
<div class="carousel slide col-2-3" id="project_carousel">
<div class="carousel-inner">
<?php while ( the_repeater_field( 'slide' ) ): ?>
<div class="item <?php echo $active; $active = ''; ?>">
<figure>
<img src="<?php the_sub_field('slide_image'); ?>" />
<figcaption>
<p><?php the_sub_field('slide_title'); ?></p>
</figcaption>
</figure>
</div>
<?php endwhile; ?>
</div>
<!-- <a class="carousel-hover-control left" href="#project_carousel" data-slide="prev"></a>
<a class="carousel-hover-control right" href="#project_carousel" data-slide="next"></a> -->
<a class="carousel-control left" href="#project_carousel" data-slide="prev">‹</a>
<a class="carousel-control right" href="#project_carousel" data-slide="next">›</a>
</div>
<?php endif; ?>
<div class="col-1-3 project_entry">
<header class="figcaption">
<h2><?php the_title(); ?></h2>
<p><?php echo $types; ?></p>
</header>
<article>
<?php the_content(); ?>
</article>
</div>
</article>
<?php endwhile; endif; ?>
<?php get_footer(); ?>