-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
302 lines (290 loc) · 11.2 KB
/
Copy pathindex.php
File metadata and controls
302 lines (290 loc) · 11.2 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
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage EpicSF
* @since EpicSF 1.0
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php if ( have_posts() ) : ?>
<?php if ( is_home() ) : ?>
<header class="home-header vertical-center">
<div class="text-center ctas">
<h1 class="variation">You are welcome here</h1>
<a class="btn primary" href="https://live.epicsf.com">Attend Online Church</a>
<a class="btn" href="/events">Stay Updated</a>
</div>
</header>
<div class="container-fluid">
<div class="row home-featured">
<?php
$featured = epic_get_featured_post();
if ( $featured ) { ?>
<div class="col-md-10 col-md-offset-2 col-xs-12">
<h2 class="h1 variation"><?php echo get_the_title($featured); ?></h2>
<div class="body3"><?php get_the_subtitle($featured) ?></div>
<div class="spacer-30"></div>
</div>
<div class="col-md-5 col-md-offset-2 col-xs-12">
<?php echo $featured->post_content; ?>
</div>
<?php } ?>
<div class="col-md-4 featured-messages col-xs-12">
<div class="spacer-30 hidden-md-up"></div>
<?php
$featured_messages = epic_get_featured_messages_post();
if ( $featured_messages ) { ?>
<?php echo $featured_messages->post_content; ?>
<?php } ?>
</div>
</div> <!-- .home-featured -->
<div class="row hidden-xs-down">
<div class="col-md-10 col-md-offset-2">
<div class="body3">Upcoming Events</div>
</div>
<div class="col-md-10 col-md-offset-1 col-xs-12">
<div class="carousel slide" id="carousel" data-ride="carousel">
<div class="carousel-inner">
<?php
$all_posts = epic_get_events();
$i = 0;
$posts = array_slice($all_posts, $i, 3);
while(count($posts)): ?>
<div class="carousel-item <?php echo $i === 0 ? 'active' : 'next'; ?>">
<div class="row">
<?php foreach($posts as $post): ?>
<div class="col-md-4 col-sm-4 col-xs-12">
<?php epic_post_thumbnail() ?>
</div>
<?php endforeach; ?>
</div> <!-- row -->
</div> <!-- item -->
<?php
$i+= 3;
$posts = array_slice($all_posts, $i, 3);
endwhile;
?>
</div> <!-- inner -->
</div> <!-- carousel.slide -->
</div> <!-- col -->
</div> <!-- row -->
<?php if (count($all_posts) > 3): ?>
<div class="row hidden-xs-down">
<div class="col-md-10 col-md-offset-1 col-xs-12">
<div class="carousel-controls text-md-right text-xs-right">
<a class="left carousel-control" href="#carousel" role="button" data-slide="prev">
<i class="fa fa-angle-left fa-lg"></i>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel" role="button" data-slide="next">
<i class="fa fa-angle-right fa-lg"></i>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div> <!-- row -->
<?php endif; ?>
<div class="row hidden-sm-up">
<div class="col-xs-12">
<div class="spacer-20"></div>
<div class="row">
<div class="col-xs-12">
<div class="body3">Upcoming Events</div>
</div>
</div>
<div class="carousel slide" id="carousel-mobile" data-ride="carousel">
<div class="carousel-inner">
<?php
$all_posts = epic_get_events();
$i = 0; ?>
<?php foreach($all_posts as $post): ?>
<div class="carousel-item <?php echo $i === 0 ? 'active' : 'next'; ?>">
<div class="row">
<div class="col-xs-12">
<?php epic_post_thumbnail() ?>
</div>
</div> <!-- row -->
</div> <!-- item -->
<?php $i++; ?>
<?php endforeach; ?>
</div> <!-- inner -->
</div> <!-- carousel.slide -->
</div> <!-- col -->
</div> <!-- row -->
<div class="row hidden-sm-up">
<div class="col-md-10 col-md-offset-1 col-xs-12">
<div class="carousel-controls text-md-right text-xs-right">
<a class="left carousel-control" href="#carousel-mobile" role="button" data-slide="prev">
<i class="fa fa-angle-left fa-lg"></i>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-mobile" role="button" data-slide="next">
<i class="fa fa-angle-right fa-lg"></i>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div> <!-- row -->
<div class="spacer-80 hidden-sm-down"></div>
<div class="spacer-60 hidden-sm-up"></div>
</div>
<?php endif; ?>
<?php
// Start the loop.
while ( !is_home() && have_posts() ) : the_post();
/*
* 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( 'template-parts/content', get_post_format() );
// End the loop.
endwhile;
endif;
?>
<?php
if ( is_home() ) {
$page = get_page_by_title('Home');
if ( $page ) { ?>
<div class="container-fluid">
<?php echo $page->post_content; ?>
</div>
<?php }
}
else {
$page = strtolower( the_title(null, null, false) );
if ( $page === 'events' ) {
$posts = epic_get_events();
if (count($posts) > 0) {
$post = $posts[0];
include( locate_template('template-parts/events/main-event.php') );
}
?>
<div class="container-fluid">
<div class="row event-snippets">
<div class="col-md-offset-1 col-md-10">
<?php
foreach ( array_chunk( array_slice($posts, 1), 2) as $row ) { ?>
<div class="row">
<?php foreach($row as $post) {
include( locate_template('template-parts/events/event-snippet.php') );
} ?>
</div>
<?php } ?>
</div>
</div>
</div>
<?php
} else if ( $page === 'media' ) {
$posts = epic_get_media();
if (count($posts) > 0) {
$post = $posts[0];
include( locate_template('template-parts/media/main-media.php') );
}
?>
<div class="container-fluid">
<div class="row media-snippets">
<div class="col-md-offset-1 col-md-10">
<?php
foreach ( array_chunk( array_slice($posts, 1), 3) as $row ) { ?>
<div class="row">
<?php foreach ($row as $post) {
include( locate_template('template-parts/media/media-snippet.php') );
} ?>
</div>
<?php } ?>
</div>
</div>
</div>
<?php
} else if ( $page === 'stories' ) {
$categories = epic_get_story_media();
?>
<div class="container-fluid">
<?php foreach($categories as $categoryName => $posts) { ?>
<div class="spacer-130 hidden-sm-down"></div>
<div class="row story-snippets">
<div class="col-md-offset-1 col-md-10 col-xs-12">
<div class="row">
<div class="col-md-4 col-sm-12">
<div class="spacer-60"></div>
<h2><?php echo $categoryName; ?></h2>
<div class="spacer-10 hidden-md-up"></div>
</div>
<div class="col-md-8 col-sm-12">
<?php
if (count($posts) > 0) {
$post = $posts[0];
include( locate_template('template-parts/stories/story-snippet.php') );
} ?>
<div class="spacer-40"></div>
</div>
</div>
</div>
<div class="col-md-offset-1 col-md-10">
<?php
foreach ( array_chunk( array_slice( $posts, 1), 3) as $row ) { ?>
<div class="row">
<?php foreach ($row as $post) { ?>
<div class="col-md-4 media-snippet col-xs-12">
<?php include( locate_template('template-parts/stories/story-snippet.php') ); ?>
</div>
<?php } ?>
</div>
<?php } ?>
</div>
</div>
<?php } /* end - stories categories */ ?>
</div>
<?php
} else if ( $page === '40 days of prayer' || $page === '2020 prayer guide' ) {
$posts = $page === '40 days of prayer' ? epic_get_40_days_media() : epic_get_2020_prayer_media();
?>
<?php
if (count($posts) > 0) {
$post = $posts[0];
include( locate_template('template-parts/40-days/featured-40-day-snippet.php') );
} ?>
<div class="container-fluid">
<div class="row story-snippets">
<div class="col-md-offset-1 col-md-10">
<?php
foreach ( array_chunk( array_slice( $posts, 1), 3) as $row ) { ?>
<div class="row">
<?php foreach ($row as $post) { ?>
<div class="col-md-4 media-snippet col-xs-12">
<?php include( locate_template('template-parts/40-days/40-day-snippet.php') ); ?>
</div>
<?php } ?>
</div>
<?php } ?>
</div>
</div>
</div>
<?php include( locate_template('template-parts/40-days/modal.php') ); ?>
<?php
} else if ( $page === 'link tree') { ?>
<div class="container-fluid entry-content">
<div class="row link-tree-snippets">
<div class="col-md-offset-2 col-md-8 col-xs-12">
<?php include( locate_template('template-parts/link-tree/link-tree.php') ); ?>
</div>
</div>
</div>
<?php
}
}
?>
</main><!-- .site-main -->
</div><!-- .content-area -->
<?php get_footer(); ?>