-
Notifications
You must be signed in to change notification settings - Fork 6
/
slides.php
133 lines (122 loc) · 6.03 KB
/
slides.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
<?php
$imagepath = get_template_directory_uri() . '/images/';
$slider_img_1 = of_get_option('slider_img_1'); if(($slider_img_1 == "")) unset($slider_img_1);
$slider_img_2 = of_get_option('slider_img_2'); if(($slider_img_2 == "")) unset($slider_img_2);
$slider_img_3 = of_get_option('slider_img_3'); if(($slider_img_3 == "")) unset($slider_img_3);
$slider_img_4 = of_get_option('slider_img_4'); if(($slider_img_4 == "")) unset($slider_img_4);
$heading_1 = trim(of_get_option('slider_image_heading_1')); if(($heading_1 == "")) unset($heading_1);
$heading_2 = trim(of_get_option('slider_image_heading_2')); if(($heading_2 == "")) unset($heading_2);
$heading_3 = trim(of_get_option('slider_image_heading_3')); if(($heading_3 == "")) unset($heading_3);
$heading_4 = trim(of_get_option('slider_image_heading_4')); if(($heading_4 == "")) unset($heading_4);
$caption_1 = trim(of_get_option('slider_image_caption_1')); if(($caption_1 == "")) unset($caption_1);
$caption_2 = trim(of_get_option('slider_image_caption_2')); if(($caption_2 == "")) unset($caption_2);
$caption_3 = trim(of_get_option('slider_image_caption_3')); if(($caption_3 == "")) unset($caption_3);
$caption_4 = trim(of_get_option('slider_image_caption_4')); if(($caption_4 == "")) unset($caption_4);
$button_1 = trim(of_get_option('slider_image_button_1')); if(($button_1 == "")) unset($button_1);
$button_2 = trim(of_get_option('slider_image_button_2')); if(($button_2 == "")) unset($button_2);
$button_3 = trim(of_get_option('slider_image_button_3')); if(($button_3 == "")) unset($button_3);
$button_4 = trim(of_get_option('slider_image_button_4')); if(($button_4 == "")) unset($button_4);
$link_1 = trim(of_get_option('slider_image_button_1_link')); if(($link_1 == "")) unset($link_1);
$link_2 = trim(of_get_option('slider_image_button_2_link')); if(($link_2 == "")) unset($link_2);
$link_3 = trim(of_get_option('slider_image_button_3_link')); if(($link_3 == "")) unset($link_3);
$link_4 = trim(of_get_option('slider_image_button_4_link')); if(($link_4 == "")) unset($link_4);
?>
<?php if(isset($slider_img_1) || isset($slider_img_2) || isset($slider_img_3) || isset($slider_img_4)) :?>
<!-- Carousel
================================================== -->
<div class="slider">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<?php if(isset($slider_img_1)): ?>
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<?php endif;?>
<?php if(isset($slider_img_2)): ?>
<li data-target="#myCarousel" data-slide-to="1"></li>
<?php endif;?>
<?php if(isset($slider_img_3)): ?>
<li data-target="#myCarousel" data-slide-to="2"></li>
<?php endif;?>
<?php if(isset($slider_img_4)): ?>
<li data-target="#myCarousel" data-slide-to="3"></li>
<?php endif;?>
</ol>
<div class="carousel-inner">
<?php if(isset($slider_img_1)): ?>
<div class="item active">
<img src="<?php echo esc_url($slider_img_1);?>" alt="">
<div class="container">
<div class="carousel-caption">
<?php if(isset($heading_1)): ?>
<h1><?php echo $heading_1;?></h1>
<?php endif;?>
<?php if(isset($caption_1)): ?>
<p><?php echo $caption_1; ?></p>
<?php endif;?>
<?php if(isset($link_1)): ?>
<p><a class="btn btn-large btn-primary" href="<?php echo get_permalink( $link_1); ?>"><?php echo $button_1; ?></a></p>
<?php endif;?>
</div>
</div>
</div>
<?php endif;?>
<?php if(isset($slider_img_2)): ?>
<div class="item">
<img src="<?php echo esc_url($slider_img_2);?>" alt="">
<div class="container">
<div class="carousel-caption">
<?php if(isset($heading_2)): ?>
<h1><?php echo $heading_2;?></h1>
<?php endif;?>
<?php if(isset($caption_2)): ?>
<p><?php echo $caption_2; ?></p>
<?php endif;?>
<?php if(isset($link_2)): ?>
<p><a class="btn btn-large btn-primary" href="<?php echo get_permalink( $link_2); ?>"><?php echo $button_2; ?></a></p>
<?php endif;?>
</div>
</div>
</div>
<?php endif;?>
<?php if(isset($slider_img_3)): ?>
<div class="item">
<img src="<?php echo esc_url($slider_img_3);?>" alt="">
<div class="container">
<div class="carousel-caption">
<?php if(isset($heading_3)): ?>
<h1><?php echo $heading_3;?></h1>
<?php endif;?>
<?php if(isset($caption_3)): ?>
<p><?php echo $caption_3; ?></p>
<?php endif;?>
<?php if(isset($link_3)): ?>
<p><a class="btn btn-large btn-primary" href="<?php echo get_permalink( $link_3); ?>"><?php echo $button_3; ?></a></p>
<?php endif;?>
</div>
</div>
</div>
<?php endif;?>
<?php if(isset($slider_img_4)): ?>
<div class="item">
<img src="<?php echo esc_url($slider_img_4);?>" alt="">
<div class="container">
<div class="carousel-caption">
<?php if(isset($heading_4)): ?>
<h1><?php echo $heading_4;?></h1>
<?php endif;?>
<?php if(isset($caption_4)): ?>
<p><?php echo $caption_4; ?></p>
<?php endif;?>
<?php if(isset($link_4)): ?>
<p><a class="btn btn-large btn-primary" href="<?php echo get_permalink( $link_4); ?>"><?php echo $button_4; ?></a></p>
<?php endif;?>
</div>
</div>
</div>
<?php endif;?>
</div>
<a class="left carousel-control" href="#myCarousel" data-slide="prev"><span><i class="icon-chevron-sign-left icon-prev-c"></i></span></a>
<a class="right carousel-control" href="#myCarousel" data-slide="next"><span><i class="icon-chevron-sign-right icon-next-c"></i></span></a>
</div><!-- /.carousel -->
</div><!-- /.slider -->
<?php endif;?>