-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle-project.php
More file actions
executable file
·146 lines (144 loc) · 4.75 KB
/
single-project.php
File metadata and controls
executable file
·146 lines (144 loc) · 4.75 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php get_header(); ?>
<main role="main" class="clearfix">
<?php while (have_posts()) : the_post(); ?>
<section>
<?php get_template_part('template-parts/page', 'header'); ?>
<div class="container container--narrow entry-container clearfix">
<div class="entry-content">
<?php
$project_meta = get_field('project_meta');
if ($project_meta) :
echo '<div class="project-meta">' . $project_meta . '</div>';
endif;
$project_description = get_field('project_description');
if ($project_description) :
echo $project_description;
endif;
?>
</div>
<?php //the_content();
?>
</div>
<div class="container container--narrow project-featured-image" data-aos="fade-left">
<?php
if (has_post_thumbnail()) :
the_post_thumbnail('hero-image');
endif;
?>
</div>
</section>
<section class="quote-section">
<?php
$blockquote = get_field('blockquote');
if ($blockquote) : ?>
<figure class="wp-block-pullquote is-style-solid-color">
<blockquote>
<p><?php echo $blockquote['quote']; ?></p>
<cite><?php echo $blockquote['cite'] ?></cite>
</blockquote>
</figure>
<?php endif; ?>
</section>
<section class="gallery-section">
<?php
$images = get_field('gallery');
if ($images) : ?>
<div id="project-slider" class="slider project-slider">
<div class="swiper-container">
<div class="swiper-wrapper">
<?php $i = 1;
foreach ($images as $image) : ?>
<div class="swiper-slide">
<a href="#" class="image-player-link" data-target="<?php echo $i; ?>" data-image-id="<?php echo esc_attr($image['id']); ?>">
<img src="<?php echo esc_url($image['sizes']['project-slider']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" data-src="<?php echo esc_url($image['url']); ?>" />
</a>
</div>
<?php $i++;
endforeach; ?>
</div>
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
<button class="open-gallery-link js-open-gallery" data-target="#project-gallery-overlay">Click to open <span></span></button>
</div>
</div>
<?php endif; ?>
</section>
<div id="project-gallery-overlay" class="b-overlay b-overlay--project">
<div class="b-overlay__header">
<div class="b-overlay__site-title"><a href="<?php echo esc_url(home_url('/')); ?>">Jaakko Heikkilä</a></div>
<h3 class="b-overlay__gallery-title"><?php the_title(); ?></h3>
<div class="b-overlay__controls category-photographer">
<div class="grid-open js-overlay-grid-open show visible">
<span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span>
</div>
<div class="grid-close js-overlay-grid-close">
<span></span>
</div>
<a href="#" class="close js-overlay-close">
<em class="line-1"></em>
<em class="line-2"></em>
</a>
</div>
</div>
<div id="project-slider-big" class="slider b-overlay__slider">
<div class="swiper-container">
<div class="swiper-wrapper">
<?php foreach ($images as $image) : ?>
<div class="swiper-slide">
<div class="content-outer">
<div class="story-big-image">
<img src="" class="swiper-lazy" alt="<?php echo esc_attr($image['alt']); ?>" data-src="<?php echo $image['url']; ?>" />
</div>
</div>
<div class="swiper-lazy-preloader swiper-lazy-preloader-black"></div>
</div>
<?php endforeach; ?>
</div>
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
<div class="swiper-pagination"></div>
</div>
<div id="project-slider-grid" class="gallery-grid b-overlay__grid">
<div class="container container--narrow">
<div class="row">
<?php
$i = 1;
foreach ($images as $image) :
?>
<div class="col">
<img data-target="<?php echo $i; ?>" src="<?php echo esc_url($image['sizes']['medium']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" />
</div>
<?php
$i++;
endforeach;
?>
</div>
</div>
</div>
</div>
<section class="projects-feed-section">
<div class="container">
<h2>Projects</h2>
</div>
<div class="container-wide">
<div class="row">
<?php
$query = new WP_Query(array(
'post_type' => 'project',
'posts_per_page' => -1,
));
if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post();
get_template_part('template-parts/content', get_post_format());
endwhile;
else :
get_template_part('template-parts/content', 'none');
wp_reset_postdata();
endif;
?>
</div>
</div>
</section>
<?php endwhile; ?>
</main>
<?php get_footer(); ?>