-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhomepage.php
139 lines (116 loc) · 5.53 KB
/
homepage.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
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
<?php /* Template Name: Homepage Template */ get_header(); ?>
<main role="main" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if ($site_address = $cfs->get('announcement')) {
?> <section id="anouncement" style="background:<?php echo CFS()->get( 'background_color' ); ?>;"> <?php
echo CFS()->get( 'annoucement_text' );
?> </section> <?php
} ?>
<section id="slider">
<ul class="bxslider">
<?php
$fields = CFS()->get( 'slide' );
foreach ( $fields as $field )
{ ?>
<li style="background-position: <?php $values = $field['image_position']; foreach ( $values as $key => $label ) { echo $label; } ?>; background-image:url(<?php echo $field['image']; ?>);" >
<a href="<?php echo $field['slider_link']; ?>" >
<div class="sliderText">
<h1><?php echo $field['header_text']; ?></h1>
<h2><?php echo $field['sub_header_text']; ?></h2>
</div>
</a>
</li>
<?php } ?>
</ul>
</section>
<section id="statement">
<div class="container">
<h2><?php echo CFS()->get( 'statement' ); ?></h2>
</div>
</section>
<section id="video">
<div class="videoWrapper">
<?php echo CFS()->get( 'video_iframe' ); ?>
</div>
</section>
<section id="form">
<div class="container">
<h2><?php echo CFS()->get( 'form_header' ); ?></h2>
<?php
function formShortCode()
{
return CFS()->get( 'form_shortcode' );
}
$formShortCode = formShortCode();
echo do_shortcode($formShortCode);
?>
</div>
</section>
<section id="intro">
<div class="container">
<div class="row">
<div class="large-7 columns image">
<img src="<?php echo CFS()->get( 'intro_image' ); ?>">
</div>
<div class="large-5 columns text">
<h2><?php echo CFS()->get( 'intro_header' ); ?></h2>
<p><?php echo CFS()->get( 'intro_text' ); ?></p>
</div>
</div>
</div>
</section>
<?php if ($site_address = $cfs->get('show_benefits')) { ?>
<section id="benefits">
<div class="container">
<h2><?php echo CFS()->get( 'benefits_header' ); ?></h2>
<div class="benefits">
<?php
$fields = CFS()->get( 'benefits' );
foreach ( $fields as $field )
{ ?>
<div class="benefit">
<img src="<?php echo $field['benefit_image']; ?>"><br>
<p><?php echo $field['benefit_description']; ?></p>
</div>
<?php } ?>
</div>
</div>
</section>
<?php } ?>
<section id="articles">
<div class="container">
<div class="row large-up-2" data-equalizer data-equalize-by-row="true">
<?php
$args = array( 'posts_per_page' => 2, 'category' => 'Featured', );
$lastposts = get_posts( $args );
foreach ( $lastposts as $post ) :
setup_postdata( $post ); ?>
<div class="column">
<article id="post-<?php the_ID(); ?>" data-equalizer-watch>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php if ( has_post_thumbnail()) : // Check if thumbnail exists ?>
<?php the_post_thumbnail('homeArticle'); // Declare pixel size you need inside the array ?>
<?php endif; ?>
<div class="textBox">
<h2>
<?php the_title(); ?>
</h2>
<p><?php echo get_the_excerpt(); ?></p>
<a class="readMore" href="<?php the_permalink(); ?>"><p>Read More</p></a>
</div>
</a>
</article>
</div>
<?php endforeach; wp_reset_postdata(); ?>
</div>
</div>
</section>
<?php if ($site_address = $cfs->get('show_bottom_content_box')) { ?>
<section id="bottom_content_box">
<div class="container">
<?php echo CFS()->get( 'bottom_content_box' ); ?>
</div>
</section>
<?php } ?>
</main>
<?php get_footer(); ?>