-
Notifications
You must be signed in to change notification settings - Fork 0
/
front.php
214 lines (187 loc) · 8.62 KB
/
front.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
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
<?php
/**
* Template Name: Home Template
*
* @package WordPress
* @subpackage Palmetto
* @since Palmetto 0.1
*/
get_header(); ?>
<!---- Three Pane Feature Functionality ---->
<section id="featured_panels">
<div class="row" data-equalizer>
<!---- Three Pane Feature Functionality ---->
<?php
$number_of_panes = get_theme_mod( 'number_of_panes', '' );
$pane_header = array();
$pane_header[] = get_theme_mod( 'pane_header_1', '' );
$pane_header[] = get_theme_mod( 'pane_header_2', '' );
$pane_header[] = get_theme_mod( 'pane_header_3', '' );
$pane_header[] = get_theme_mod( 'pane_header_4', '' );
$pane_icon = array();
$pane_icon[] = get_theme_mod( 'pane_icon_1', '' );
$pane_icon[] = get_theme_mod( 'pane_icon_2', '' );
$pane_icon[] = get_theme_mod( 'pane_icon_3', '' );
$pane_icon[] = get_theme_mod( 'pane_icon_4', '' );
$pane_text = array();
$pane_text[] = get_theme_mod( 'pane_text_1', '' );
$pane_text[] = get_theme_mod( 'pane_text_2', '' );
$pane_text[] = get_theme_mod( 'pane_text_3', '' );
$pane_text[] = get_theme_mod( 'pane_text_4', '' );
if ($number_of_panes !== 0) {
if ($number_of_panes == 1) { ?>
<?php for ($i=0; $i < 1; $i++) { ?>
<div class="large-8 columns large-offset-2">
<div class="panel" data-equalizer-watch>
<h2 class="text-center"><i class="fa <?php echo $pane_icon[$i]; ?>"></i></h2>
<h2 class="text-center"><?php echo $pane_header[$i]; ?></h2>
<p><?php echo $pane_text[$i]; ?></p>
</div>
</div>
<?php } ?>
<?php } elseif ($number_of_panes == 2) { ?>
<?php for ($i=0; $i < 2; $i++) { ?>
<div class="large-6 columns">
<div class="panel" data-equalizer-watch>
<h2 class="text-center"><i class="fa <?php echo $pane_icon[$i]; ?>"></i></h2>
<h2 class="text-center"><?php echo $pane_header[$i]; ?></h2>
<p><?php echo $pane_text[$i]; ?></p>
</div>
</div>
<?php } ?>
<?php } elseif ($number_of_panes == 3) { ?>
<?php for ($i=0; $i < 3; $i++) { ?>
<div class="large-4 columns">
<div class="panel" data-equalizer-watch>
<h2 class="text-center"><i class="fa <?php echo $pane_icon[$i]; ?>"></i></h2>
<h2 class="text-center"><?php echo $pane_header[$i]; ?></h2>
<p><?php echo $pane_text[$i]; ?></p>
</div>
</div>
<?php } ?>
<?php } elseif ($number_of_panes == 4) { ?>
<?php for ($i=0; $i < 4; $i++) { ?>
<div class="large-3 columns">
<div class="panel" data-equalizer-watch>
<h2 class="text-center"><i class="fa <?php echo $pane_icon[$i]; ?>"></i></h2>
<h2 class="text-center"><?php echo $pane_header[$i]; ?></h2>
<p><?php echo $pane_text[$i]; ?></p>
</div>
</div>
<?php } ?>
<?php }
} ?>
</div>
</section> <!-- panel section -->
<!--- FRONT PAGE SECTION FOR SAMPLE OF LISTINGS -->
<?php
$show_featured_listings= get_theme_mod( 'show_featured_listings', '1' );
$featured_listing_title = array();
$featured_listing_title[] = get_theme_mod( 'featured_listing_1_title', '' );
$featured_listing_title[] = get_theme_mod( 'featured_listing_2_title', '' );
$featured_listing_title[] = get_theme_mod( 'featured_listing_3_title', '' );
$featured_listing_url = array();
$featured_listing_url[] = get_theme_mod( 'featured_listing_1_url', '' );
$featured_listing_url[] = get_theme_mod( 'featured_listing_2_url', '' );
$featured_listing_url[] = get_theme_mod( 'featured_listing_3_url', '' );
$featured_listing_image = array();
$featured_listing_image[] = get_theme_mod( 'featured_listing_1_image_url', '' );
$featured_listing_image[] = get_theme_mod( 'featured_listing_2_image_url', '' );
$featured_listing_image[] = get_theme_mod( 'featured_listing_3_image_url', '' );
$featured_listing_num_bedrooms = array();
$featured_listing_num_bedrooms[] = get_theme_mod( 'featured_listing_1_num_bedrooms', '' );
$featured_listing_num_bedrooms[] = get_theme_mod( 'featured_listing_2_num_bedrooms', '' );
$featured_listing_num_bedrooms[] = get_theme_mod( 'featured_listing_3_num_bedrooms', '' );
$featured_listing_num_bathrooms = array();
$featured_listing_num_bathrooms[] = get_theme_mod( 'featured_listing_1_num_bathrooms', '' );
$featured_listing_num_bathrooms[] = get_theme_mod( 'featured_listing_2_num_bathrooms', '' );
$featured_listing_num_bathrooms[] = get_theme_mod( 'featured_listing_3_num_bathrooms', '' );
$featured_listing_num_cars = array();
$featured_listing_num_cars[] = get_theme_mod( 'featured_listing_1_num_cars', '' );
$featured_listing_num_cars[] = get_theme_mod( 'featured_listing_2_num_cars', '' );
$featured_listing_num_cars[] = get_theme_mod( 'featured_listing_3_num_cars', '' );
$featured_listing_description = array();
$featured_listing_description[] = get_theme_mod( 'featured_listing_1_description', '' );
$featured_listing_description[] = get_theme_mod( 'featured_listing_2_description', '' );
$featured_listing_description[] = get_theme_mod( 'featured_listing_3_description', '' );
$listing_placeholder_image= get_theme_mod( 'listing_placeholder_image', '' );
if ($show_featured_listings) { ?>
<section class="white-section">
<div class="row white">
<h2>Featured Listings</h2>
<p>Some of our featured long-term home rentals. <a href="/listings/">View all listings on our Homes For Rent page.</a></p>
</div>
<div class="row" data-equalizer>
<?php for ($i = 0; $i <= 2; $i++) { ?>
<div class="large-4 columns">
<?php if ($featured_listing_title[$i]) { ?>
<div class="listing-box" data-equalizer-watch>
<div class="listing-image">
<?php if ($featured_listing_image[$i]) { ?>
<img src="<?php echo $featured_listing_image[$i]; ?>" />
<?php } elseif ($listing_placeholder_image) { ?>
<img src="<?php echo $listing_placeholder_image; ?>" />
<?php } else { ?>
<img src="<?php echo get_template_directory_uri() . '/assets/img/dft-placeholder-listing.jpg'; ?>" />
<?php } ?>
</div>
<div class="listing-details">
<?php if ($featured_listing_num_bedrooms[$i]) { ?><i class="fa fa-bed"></i> <?php echo $featured_listing_num_bedrooms[$i]; ?> Bedrooms | <?php } ?>
<?php if ($featured_listing_num_bathrooms[$i]) { ?><i class="fa fa-shower"></i> <?php echo $featured_listing_num_bathrooms[$i]; ?> Bathrooms | <?php } ?>
<?php if ($featured_listing_num_cars[$i]) { ?><i class="fa fa-car"></i> <?php echo $featured_listing_num_cars[$i]; ?> Cars <?php } ?>
</div>
<div class="listing-text">
<h4><a href="<?php echo $featured_listing_url[$i]; ?>"><?php echo $featured_listing_title[$i]; ?></a></h4>
<p><?php echo $featured_listing_description[$i]; ?></p><p class="text-center">
<a class="button text-center" href="<?php echo $featured_listing_url[$i]; ?>">View Listing</a></p>
</div>
</div>
<?php } ?>
</div>
<?php } ?>
</div>
<?php } ?>
</section> <!-- listing section -->
<section id="blog">
<div class="row">
<?php
global $post;
$myposts = get_posts('numberposts=3');
$counter = 0;
if (sizeof($myposts) > 0) { ?>
<h2>Latest Blog Entries</h2>
<p>The latest of our blog entries. <a href="/blog">View the entire blog here.</a></p>
</div>
<div class="row" data-equalizer>
<?php }
foreach($myposts as $post) :?>
<?php
// Get thumbnail image if exists
$thumb_id = get_post_thumbnail_id($post->ID);
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail-size', true);
$thumb_url = $thumb_url_array[0];
$blog_placeholder_image= get_theme_mod( 'blog_placeholder_image', '' );
?>
<div class="large-4 columns <?php if ( ($counter + 1) == sizeof($myposts)) { echo "end";} ?>">
<div class="listing-box" data-equalizer-watch>
<div class="listing-image">
<?php if ($thumb_url && strpos($thumb_url,'default') === false) { ?>
<img src="<?php the_post_thumbnail(); ?>" />
<?php } elseif ($blog_placeholder_image) { ?>
<img src="<?php echo $blog_placeholder_image; ?>" />
<?php } else { ?>
<img src="<?php echo get_template_directory_uri() . '/assets/img/dft-placeholder-blog.jpg'; ?>" />
<?php } ?>
</div>
<div class="listing-text">
<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
<?php the_content(); ?>
<a class="button text-center" href="<?php the_permalink(); ?>">View Post</a></p>
</div>
</div>
</div>
<?php $counter++; ?>
<?php endforeach; ?>
</div>
</section> <!-- blog post section -->
<?php get_footer(); ?>