-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfront-page.php
More file actions
123 lines (80 loc) · 2.67 KB
/
front-page.php
File metadata and controls
123 lines (80 loc) · 2.67 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
<?php
/**
* Frontpage Template
* @since 1.1.0
*
* @package RBMTheme
*/
global $post;
get_header();
while ( have_posts() ) : the_post(); ?>
<header class="front-hero" role="banner">
<div class="marketing main-wrap">
<div class="image">
<div class="color-overlay"></div>
</div>
<div class="expanded row tagline">
<div class="small-12 columns">
<?php the_content(); ?>
</div>
</div>
</div>
</header>
<div class="main-wrap row case-studies-header">
<div class="small-12 columns text-center">
<?php echo apply_filters( 'the_content', rbm_theme_get_field( 'case_studies_header' ) ); ?>
</div>
</div>
<div class="main-wrap case-studies-slider">
<div class="small-12 columns">
<div class="orbit" role="region" aria-label="Favorite Space Pictures" data-orbit data-timer-delay="30000">
<ul class="orbit-container">
<button class="orbit-previous" aria-label="previous">
<span class="show-for-sr"><?php _e( 'Previous Slide', 'rbm-theme' ); ?></span>◀
</button>
<button class="orbit-next" aria-label="next"><span class="show-for-sr">
<?php _e( 'Next Slide', 'rbm-theme' ); ?></span>▶
</button>
<?php
$is_first = true;
$case_studies = new WP_Query( array(
'post_type' => 'case-studies',
'posts_per_page' => -1,
) );
if ( $case_studies->have_posts() ) :
while ( $case_studies->have_posts() ) : $case_studies->the_post();
include locate_template( 'template-parts/loop/loop-home-case-studies.php' );
endwhile;
wp_reset_postdata();
else : ?>
<li class="is-active orbit-slide">
<?php _e( 'No Case Studies created yet', 'rbm-theme' ); ?>
</li>
<?php endif;
?>
</ul>
<nav class="orbit-bullets">
<?php
$is_first = true;
$index = 0;
$case_studies->rewind_posts();
if ( $case_studies->have_posts() ) :
while ( $case_studies->have_posts() ) : $case_studies->the_post(); ?>
<button <?php echo ( $is_first ? 'class="is-active" ' : '' ); ?>data-slide="<?php echo $index; ?>">
<span class="show-for-sr"><?php the_title(); ?></span>
<?php if ( $is_first ) : ?>
<span class="show-for-sr"><?php echo __( 'Current Slide', 'rbm-theme' ); ?></span>
<?php endif; ?>
</button>
<?php
$is_first = false;
$index++;
endwhile;
wp_reset_postdata();
endif;
?>
</nav>
</div>
</div>
<?php endwhile;
get_footer();