-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate-home.php
More file actions
308 lines (205 loc) · 8.58 KB
/
template-home.php
File metadata and controls
308 lines (205 loc) · 8.58 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<?php
/**
Template Name: Home Page
*
* @package luna
*/
get_header(); ?>
<?php if ( get_theme_mod( 'luna_home_bg_image' ) ) : ?>
<section id="home-hero" style="background-image: url('<?php echo esc_url( get_theme_mod( 'luna_home_bg_image' )); ?>');">
<?php else: ?>
<section id="home-hero">
<?php endif; ?>
<div class="grid grid-pad">
<div class="col-1-1">
<?php if ( get_theme_mod( 'luna_home_title' ) ) : ?>
<h1><?php echo wp_kses_post( get_theme_mod( 'luna_home_title' )); ?></h1>
<?php endif; ?>
<?php if ( get_theme_mod( 'luna_home_text' ) ) : ?>
<p><?php echo wp_kses_post( get_theme_mod( 'luna_home_text' )); ?></p>
<?php endif; ?>
<?php if ( get_theme_mod( 'luna_home_button_url' ) ) : ?>
<a href="<?php echo esc_url( get_page_link( get_theme_mod('luna_home_button_url'))) ?>" class="featured-link">
<?php endif; ?>
<?php if ( get_theme_mod( 'luna_home_button_text' ) ) : ?>
<button>
<?php echo esc_html( get_theme_mod( 'luna_home_button_text' )); ?>
</button>
<?php endif; ?>
<?php if ( get_theme_mod( 'luna_home_button_url' ) ) : ?>
</a>
<?php endif; ?>
</div>
</div>
<?php if ( get_theme_mod( 'luna_home_bg_image' ) ) : ?>
</section>
<?php else: ?>
</section>
<?php endif; ?>
<!-- PULL IN POSTS -->
<section id="page-content-container" class="blog-post-archive">
<?php
// let's grab the banner image before we run the query for cat=8
// bloody WordPress queries LOL...
$bannerImage = get_field('banner_image');
$bannerTitle = get_field('banner_title');
$bannerSubtitle = get_field('banner_subtitle');
$bannerLink = get_field('banner_link');
$buttonLabel = get_field('banner_button_label');
// showMeTheGoods($bannerImage);
?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<!-- INTRO -->
<div class="intro">
<div class="grid grid-pad">
<div class="col-1-1">
<h1><?php echo get_field('intro_greeting');?></h1>
<h3><?php echo get_field('intro_blurb'); ?></h3>
<!-- <a href="<?php echo $bannerLink; ?>" class="featured-link"><button><?php echo $buttonLabel; ?></button></a> -->
</div>
</div>
</div>
<!-- INFO PANELS -->
<div class="info-panels">
<?php if( have_rows('info_panel') ): ?>
<?php
$rowIndex = 0;
while( have_rows('info_panel') ): the_row();
$isEven = $rowIndex % 2;
$infoPanelImage = get_sub_field('info_panel_image');
?>
<div class="grid grid-pad single-info-panel">
<div class="col-1-2 info-panel-blurb">
<h1><?php echo get_sub_field('panel_number');?></h1>
<?php echo get_sub_field('info_panel_text');?>
</div>
<div class="col-1-2 info-panel-image" style="background-image: url('<?php echo $infoPanelImage['url'] ;?>');">
</div>
</div>
<?php
$rowIndex++;
endwhile;
?>
<?php endif; ?>
</div>
<!-- TESTIMONIALS -->
<div class="testimonials">
<div class="grid grid-pad">
<div class="col-1-1">
<div class="section-intro">
<h1><?php echo get_field('section_1_heading');?></h1>
</div>
</div>
</div>
<div class="grid grid-pad">
<?php if( have_rows('testimonial_profiles') ): ?>
<?php while( have_rows('testimonial_profiles') ): the_row();
$userPic = get_sub_field('user_pic');
$userQuote = get_sub_field('user_quote');
?>
<div class="col-1-4">
<div class="user-pic" style="background-image: url('<?php echo $userPic['url'] ; ?>');"></div>
<!-- quote -->
<div class="user-quote">
<?php echo $userQuote ; ?>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
<!-- BLOG -->
<div class="blog-feed-mini">
<div class="grid grid-pad">
<div class="col-1-1">
<div class="section-intro">
<h1><?php echo get_field('section_2_heading');?></h1>
<h3><?php echo get_field('section_2_blurb'); ?></h3>
<!-- <a href="<?php echo $bannerLink; ?>" class="featured-link"><button><?php echo $buttonLabel; ?></button></a> -->
</div>
</div>
</div>
<?php
/* get all the posts which category id is 8 */
query_posts('cat=8&posts_per_page=2');
?>
<?php
if ( have_posts() ) : ?>
<div class="grid grid-pad">
<?php while ( have_posts() ) : the_post(); ?>
<div class="col-1-2">
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
</div>
<?php endwhile; ?>
</div>
<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>
<?php
// Reset Query
wp_reset_query();
?>
<?php
/* get all the posts which category id is 3 */
query_posts('cat=3&posts_per_page=2');
?>
<?php
if ( have_posts() ) : ?>
<div class="grid grid-pad">
<?php while ( have_posts() ) : the_post(); ?>
<div class="col-1-2">
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
</div>
<?php endwhile; ?>
</div>
<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>
<?php
// Reset Query
wp_reset_query();
?>
</div>
<!-- OUTRO -->
<div class="outro">
<div class="grid grid-pad">
<div class="col-1-1">
<h2><?php echo get_field('outro');?></h2>
</div>
</div>
</div>
</main><!-- #main -->
</div><!-- #primary -->
</section>
<!-- WORKSHEETS OPT-IN -->
<section class="opt-in">
<div class="grid grid-pad">
<div class="col-1-1">
<div class="content">
<div class="banner-image" style="background-image: url('<?php echo $bannerImage['url']; ?>');">
<div class="grid grid-pad">
<div class="col-1-1">
<h1><?php echo $bannerTitle; ?></h1>
<h2><?php echo $bannerSubtitle; ?></h2>
<a href="<?php echo $bannerLink; ?>" class="featured-link"><button><?php echo $buttonLabel; ?></button></a>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<?php get_footer(); ?>