-
Notifications
You must be signed in to change notification settings - Fork 0
/
front-page.php
144 lines (93 loc) · 4.35 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
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
<?php
/**
* Front Page template
*
* @since 0.1.0
* @package wasentha
*/
// Don't load directly
if ( ! defined( 'ABSPATH' ) ) {
die;
}
get_header();
the_post();
?>
<div id="intro-message" class="row collapse">
<div class="media-object stack-for-small">
<div class="media-object-section">
<?php echo wp_get_attachment_image( get_theme_mod( 'home_page_intro_image', 9 ), 'medium', false, array( 'class' => 'thumbnail' ) ); ?>
</div>
<div class="media-object-section">
<h1 class="title"><?php echo get_bloginfo( 'name' ); ?></h1>
<?php echo apply_filters( 'the_content', get_theme_mod( 'home_page_intro_paragraph', 'Enter Text in the Customizer' ) ); ?>
</div>
</div>
</div>
<?php if ( have_rows( 'wasentha_slides' ) ) : ?>
<section id="home-slider" class="row collapse realbig-slider-container">
<div class="realbig-slider">
<div class="inner">
<?php
$first = true;
$index = 0;
while ( have_rows( 'wasentha_slides' ) ) : the_row();
?>
<?php
$photo = get_sub_field( 'photo' );
$url = get_sub_field( 'button_link' );
// If the user forgot a protocol, we need to add it
$has_http = preg_match_all( '/(http)?(s)?(:)?(\/\/)/', $url, $matches );
if ( $has_http == 0 ) {
$url = '//' . $url;
}
?>
<div class="slide<?php echo ( ( $first === true ) ? ' active' : '' ); ?>">
<?php if ( ( $index % 2 ) > 0 ) : ?>
<div class="small-6 columns image" style="background-image: url( '<?php echo $photo['sizes']['medium']; ?> '); background-color: <?php echo get_sub_field( 'photo_background' ); ?>">
</div>
<?php endif; ?>
<div class="small-6 columns text">
<<?php echo get_sub_field( 'descriptor_size' ); ?>><?php echo get_sub_field( 'descriptor' ); ?></<?php echo get_sub_field( 'descriptor_size' ); ?>>
<a href="<?php echo $url; ?>" class="button"><?php echo get_sub_field( 'button_text' ); ?></a>
</div>
<?php if ( ( $index % 2 ) == 0 ) : ?>
<div class="small-6 columns image" style="background-image: url( '<?php echo $photo['sizes']['medium']; ?> '); background-color: <?php echo get_sub_field( 'photo_background' ); ?>">
</div>
<?php endif; ?>
</div>
<?php
$first = false;
$index++;
endwhile;
?>
</div>
<div class="arrow arrow-left"></div>
<div class="arrow arrow-right"></div>
<ul class="indicators"></ul>
</div>
</section>
<?php endif; ?>
<section id="page-<?php the_ID(); ?>" <?php body_class( array( 'page-content' ) ); ?>>
<div class="row">
<div class="small-12 columns">
<div class="page-copy">
<?php the_content(); ?>
</div>
</div>
</div>
</section>
<section id="workshops-exhibits" class="row collapse">
<div class="small-12 medium-6 columns valign-center text-center">
<h2><?php echo get_theme_mod( 'home_page_workshop_title', 'Workshops' ); ?></h2>
<?php dynamic_sidebar( 'seminar-sidebar' ); ?>
</div>
<div class="small-12 medium-6 columns valign-center text-center">
<h2><?php echo get_theme_mod( 'home_page_exhibits_title', 'Current Exhibits' ); ?></h2>
<?php dynamic_sidebar( 'presentation-sidebar' ); ?>
</div>
</section>
<section id="recent-posts">
<?php echo do_shortcode( '[wasentha_post excerpt=true date=true classes="home-blogs-list" title="' . get_theme_mod( 'wasentha_recent_posts_title', 'Recent Blog Posts' ) . '" posts_per_page=' . get_theme_mod( 'wasentha_recent_posts_limit', 5 ) . ']' ); ?>
</section>
<?php
get_footer();