-
Notifications
You must be signed in to change notification settings - Fork 1
/
home-page.php
executable file
·138 lines (117 loc) · 4.94 KB
/
home-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
<?php
/*
Template Name: Home Page
*/
get_header();
?>
</head>
<body <?php body_class(); ?>>
<nav class="pushy pushy-right mobileshow">
<?php wp_nav_menu( array( 'theme_location' => 'main-menu', 'container_class' => 'mobilemenu' ) ); ?>
</nav>
<div class="site-overlay"></div>
<div id="container">
<?php if(get_field('header_layout', 'option') == "nav_ontop"): ?>
<?get_template_part('inc/nav');?>
<div class="wide-container home-head">
<?php while(the_flexible_field("home_banner_options")): ?>
<?php if(get_row_layout() == "slider"): // layout: Main Content with bg image ?>
<div class="header-content">
<ul class="bxslider slider-header">
<?php if(get_sub_field('slider_images')): ?>
<?php while(has_sub_field('slider_images')): ?>
<?php $bannerimage = wp_get_attachment_image_src(get_sub_field('image'), 'banner-image'); ?>
<li class="<?php the_sub_field('darkened_overlay'); ?>" style="background-image: url(<?php echo $bannerimage[0]; ?>);">
<div class="slide-content col span_14 centered">
<h2><?php the_sub_field('slide_title');?> </h2>
<p class="intro"><?php the_sub_field('slide_content');?> </p>
</div>
</li>
<?php endwhile; ?>
<?php endif; ?>
</ul>
</div>
<?php elseif(get_row_layout() == "single_image"): // layout: General Content with bg image ?>
<?php $singlebannerimage = wp_get_attachment_image_src(get_sub_field('image'), 'banner-image'); ?>
<div class="header-content single-header-image <?php the_sub_field('darkened_overlay'); ?>" style="color:<?php the_sub_field('font_color'); ?>;background-image: url(<?php echo $singlebannerimage[0]; ?>);">
<div class="container">
<div class="row">
<div class="col span_16 centered-section slide-content">
<?php if( $general_title = get_sub_field('title') ){ ?>
<h3 class="content-heading"><?php echo $general_title; ?></h3>
<?php }?>
<?php if( $general_content = get_sub_field('content') ){ ?>
<p><?php echo $general_content; ?></p>
<?php }?>
</div>
</div>
</div>
</div>
<?php endif; ?><!-- end flexible sections -->
<?php endwhile; ?><!-- end flexible fields -->
</div>
<?php elseif(get_field('header_layout', 'option') == "nav_overlay"): ?>
<div class="wide-container home-head">
<?get_template_part('inc/nav','dark');?>
<?php while(the_flexible_field("home_banner_options")): ?>
<?php if(get_row_layout() == "slider"): // layout: Main Content with bg image ?>
<div class="header-content">
<ul class="bxslider slider-header">
<?php if(get_sub_field('slider_images')): ?>
<?php while(has_sub_field('slider_images')): ?>
<?php $bannerimage = wp_get_attachment_image_src(get_sub_field('image'), 'banner-image'); ?>
<li class="<?php the_sub_field('darkened_overlay'); ?>" style="background-image: url(<?php echo $bannerimage[0]; ?>);">
<div class="slide-content col span_14 centered">
<h2><?php the_sub_field('slide_title');?> </h2>
<p class="intro"><?php the_sub_field('slide_content');?> </p>
</div>
</li>
<?php endwhile; ?>
<?php endif; ?>
</ul>
</div>
<?php elseif(get_row_layout() == "single_image"): // layout: General Content with bg image ?>
<?php $singlebannerimage = wp_get_attachment_image_src(get_sub_field('image'), 'banner-image'); ?>
<div class="header-content single-header-image <?php the_sub_field('darkened_overlay'); ?>" style="color:<?php the_sub_field('font_color'); ?>;background-image: url(<?php echo $singlebannerimage[0]; ?>);">
<div class="container">
<div class="row">
<div class="col span_16 centered-section slide-content">
<?php if( $general_title = get_sub_field('title') ){ ?>
<h3 class="content-heading"><?php echo $general_title; ?></h3>
<?php }?>
<?php if( $general_content = get_sub_field('content') ){ ?>
<p><?php echo $general_content; ?></p>
<?php }?>
</div>
</div>
</div>
</div>
<?php endif; ?><!-- end flexible sections -->
<?php endwhile; ?><!-- end flexible fields -->
</div>
<?php endif ?>
<div class="wide-container pin nav-pin">
<div class="container">
<div class="row">
<div class="nav mobilehide navigation col span_24 <?php the_field('nav_color','options'); ?>">
<?php wp_nav_menu( array( 'theme_location' => 'main-menu', 'container_class' => 'menu' ) ); ?>
</div>
</div>
</div>
</div>
<?php
get_template_part('inc/flexible','content');
get_footer();
?>
<script>
$('.slider-header').bxSlider({
mode: 'fade',
minSlides: 1,
maxSlides: 1,
moveSlides: 0,
auto: true,
autoStart: true,
slideWidth: 0,
pager: true
});
</script>