-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
91 lines (72 loc) · 2.78 KB
/
front-page.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
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
<?php
get_header();
/* =============== *\
* Page Banner *
\* =============== */
// re-define page banner variables
$banner_image = get_field('banner_image');
$banner_header = get_field('banner_header');
$banner_text = get_field('banner_text');
$banner_cta_link = get_field('banner_cta_link');
$banner_cta_text = get_field('banner_cta_text');
// load page banner template
include( locate_template('components/banner.php') );
/* ======================= *\
* Newsletter Signup *
\* ======================= */
$form_embed_code = get_field('form_embed_code');
include( locate_template('components/newsletter.php') );
/* ============ *\
* Features *
\* ============ */
if ( have_rows('features') ) {
while ( have_rows('features') ) {
// initiate data
the_row();
// define variables
$feature_image = get_sub_field('feature_image');
$feature_subheader = get_sub_field('feature_subheader');
$feature_title = get_sub_field('feature_title');
$feature_copy = get_sub_field('feature_copy');
$feature_action_text = get_sub_field('feature_action_text');
$feature_action_link = get_sub_field('feature_action_link');
$feature_secondary_action_text = get_sub_field('feature_secondary_action_text');
$feature_secondary_action_link = get_sub_field('feature_secondary_action_link');
// load feature template
include( locate_template('components/feature.php') );
}
}
/* ============ *\
* Projects *
\* ============ */
// loop through page sections
if ( have_rows('projects') ) {
while ( have_rows('projects') ) {
// initiate data
the_row();
// define page section variables
$section_image = get_sub_field('project_image');
$section_subheader = get_sub_field('project_subheader');
$section_header = get_sub_field('project_title');
$section_copy = get_sub_field('project_text');
$section_action_text = get_sub_field('project_action_text');
$section_action_link = get_sub_field('project_action_link');
$section_action_embed = get_sub_field('project_action_embed');
$section_secondary_action_link = get_sub_field('project_secondary_action_link');
$section_secondary_action_text = get_sub_field('project_secondary_action_text');
// load section template
include( locate_template('components/section.php') );
}
}
/* ================= *\
* Donate Block *
\* ================= */
// define variables for donate CTA at bottom of layout
$donate_header = get_field('donate_header');
$donate_copy = get_field('donate_copy');
$donate_embed = get_field('donate_embed');
$donate_secondary_action_text = get_field('donate_secondary_action_text');
$donate_secondary_action_link = get_field('donate_secondary_action_link');
// load donate CTA
include( locate_template('components/donate-block.php') );
get_footer();