PluginProbe
SpiceBox / 0.6
SpiceBox v0.6
trunk 0.2.2 0.2.3 0.2.4 0.2.5 0.2.6 0.2.7 0.2.8 0.2.9 0.3 0.3.1 0.3.2 0.3.3 0.3.4 0.3.5 0.3.6 0.3.7 0.3.8 0.3.9.1 0.3.9.2 0.4 0.5 0.6 0.7 1.0 All 76 releases
spicebox / inc / spicepress / sections / spicepress-features-section.php

spicepress-features-section.php in SpiceBox 0.6, at inc/spicepress/sections/spicepress-features-section.php

205 lines 7.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Services section for the homepage.
4 */
5 if ( ! function_exists( 'spiceb_spicepress_service' ) ) :
6
7 function spiceb_spicepress_service() {
8
9 $home_service_section_enabled = get_theme_mod('home_service_section_enabled','on');
10 $home_service_section_title = get_theme_mod('home_service_section_title',__('What we Offer?','spicepress'));
11 $home_service_section_discription = get_theme_mod('home_service_section_discription','Sea summo mazim ex, ea errem eleifend definitionem vim. Ut nec hinc dolor possim mei ludus efficiendi ei sea summo mazim ex.');
12 $spicepress_service_content = get_theme_mod( 'spicepress_service_content', spiceb_spicepress_get_service_default() );
13 $section_is_empty = empty( $spicepress_service_content ) && empty( $home_service_section_discription ) && empty( $home_service_section_title );
14 if($home_service_section_enabled !='off')
15 {
16 ?>
17 <!-- Section Title -->
18 <section class="service-section">
19 <div class="container">
20 <?php if( ($home_service_section_title) || ($home_service_section_discription)!='' ) { ?>
21 <div class="row">
22 <div class="col-md-12">
23 <div class="section-header">
24 <?php if ( ! empty( $home_service_section_title ) || is_customize_preview() ) : ?>
25 <h1 class="widget-title">
26 <?php echo $home_service_section_title; ?>
27 </h1>
28 <?php endif; ?>
29 <div class="widget-separator"><span></span></div>
30 <?php if($home_service_section_discription) {?>
31 <div class="separator"><span></span></div>
32 <p class="wow fadeInDown animated">
33 <?php echo $home_service_section_discription; ?>
34 </p>
35 <?php } ?>
36 </div>
37 </div>
38 </div>
39 <!-- /Section Title -->
40 <?php }
41 spiceb_spicepress_service_content( $spicepress_service_content );
42 ?>
43 </div>
44 </section>
45 <?php } }
46
47 endif;
48
49
50 function spiceb_spicepress_service_content( $spicepress_service_content, $is_callback = false ) {
51 if ( ! $is_callback ) {
52 ?>
53
54 <?php
55 }
56 if ( ! empty( $spicepress_service_content ) ) :
57
58 $allowed_html = array(
59 'br' => array(),
60 'em' => array(),
61 'strong' => array(),
62 'b' => array(),
63 'i' => array(),
64 );
65
66 $spicepress_service_content = json_decode( $spicepress_service_content );
67 if ( ! empty( $spicepress_service_content ) ) {
68 $i = 1;
69 echo '<div class="row" id="service_content_section">';
70 foreach ( $spicepress_service_content as $service_item ) :
71 $icon = ! empty( $service_item->icon_value ) ? $service_item->icon_value : '';
72 $image = ! empty( $service_item->image_url ) ? $service_item->image_url: '';
73 $title = ! empty( $service_item->title ) ? $service_item->title : '';
74 $text = ! empty( $service_item->text ) ? $service_item->text : '';
75 $link = ! empty( $service_item->link ) ? $service_item->link : '';
76 $color = ! empty( $service_item->color ) ? $service_item->color : '';
77 $choice = ! empty( $service_item->choice ) ? $service_item->choice : 'customizer_repeater_icon';
78 $open_new_tab = ! empty( $service_item->open_new_tab ) ? $service_item->open_new_tab : 'no';
79
80 ?>
81 <div class="col-md-4 col-sm-6 col-xs-12">
82 <div class="post text-center wow flipInX animated" data-wow-delay=".5s">
83
84 <?php if($choice == 'customizer_repeater_image'){ ?>
85 <?php if ( ! empty( $image ) ) : ?>
86 <figure class="post-thumbnail">
87
88 <?php if ( ! empty( $link ) ) : ?>
89 <a href="<?php echo esc_url( $link ); ?>" <?php if($open_new_tab == 'yes'){ echo 'target="_blank"';}?>>
90 <?php endif; ?>
91 <img class="services_cols_mn_icon"
92 src="<?php echo esc_url( $image ); ?>" <?php if ( ! empty( $title ) ) : ?> alt="<?php echo esc_attr( $title ); ?>" title="<?php echo esc_attr( $title ); ?>" <?php endif; ?> />
93 <?php if ( ! empty( $link ) ) : ?>
94 </a>
95 <?php endif; ?>
96 <?php endif; ?>
97 </figure>
98 <?php } ?>
99
100 <?php if($choice == 'customizer_repeater_icon'){ ?>
101
102 <?php if ( ! empty( $icon ) ) :?>
103 <figure class="post-thumbnail">
104 <?php if ( ! empty( $link ) ) : ?>
105 <a href="<?php echo esc_url( $link ); ?>" <?php if($open_new_tab == 'yes'){ echo 'target="_blank"';}?> >
106 <?php endif; ?>
107
108 <i class="fa <?php echo esc_html( $icon ); ?> txt-pink"></i>
109
110 <?php if ( ! empty( $link ) ) : ?>
111 </a>
112 <?php endif; ?>
113 </figure>
114 <?php endif; ?>
115 <?php } ?>
116
117 <?php if ( ! empty( $title ) ) : ?>
118
119 <?php if ( ! empty( $link ) ) : ?>
120 <a href="<?php echo esc_url( $link ); ?>" <?php if($open_new_tab == 'yes'){ echo 'target="_blank"';}?> >
121 <?php endif; ?>
122
123 <div class="entry-header">
124 <h4 class="entry-title"><?php echo esc_html( $title ); ?></h4>
125 </div>
126 <?php if ( ! empty( $link ) ) : ?>
127 </a>
128 <?php endif; ?>
129
130 <?php endif; ?>
131 <?php if ( ! empty( $link ) ) : ?>
132 </a>
133 <?php endif; ?>
134 <?php if ( ! empty( $text ) ) : ?>
135
136 <div class="entry-content">
137 <p><?php echo wp_kses( html_entity_decode( $text ), $allowed_html ); ?></p>
138 </div>
139
140
141 <?php endif; ?>
142 </div>
143 </div>
144 <?php
145 if ( $i % apply_filters( 'spicepress_service_per_row_no', 3 ) == 0 ) {
146 echo '</div><!-- /.row -->';
147 echo '<div class="row">';
148 }
149 $i++;
150
151 endforeach;
152 echo '</div>';
153 }// End if().
154 endif;
155 if ( ! $is_callback ) {
156 ?>
157
158 <?php
159 }
160 }
161
162 /**
163 * Get default values for service section.
164 *
165 * @since 1.1.31
166 * @access public
167 */
168 function spiceb_spicepress_get_service_default() {
169
170 return apply_filters(
171 'spicepress_service_content', json_encode(
172 array(
173 array(
174 'icon_value' => 'fa-laptop',
175 'title' => esc_html__( 'Easy to Use', 'spicepress' ),
176 'text' => 'Phasellus facilisis, nunc in lacinia auctor, eros lacus aliquet velit, quis lobortis risus nunc nec nisi maecans et turpis vitae velit.volutpat porttitor a sit amet est. In eu rutrum ante. Nullam id lorem fermentum, accumsan enim non auctor neque.', 'spicepress',
177 'choice' => 'customizer_repeater_icon',
178 'link' => '#',
179 'open_new_tab' => 'no',
180 ),
181 array(
182 'icon_value' => 'fa fa-cogs',
183 'title' => esc_html__( 'Multi-Purpose', 'spicepress' ),
184 'text' => 'Phasellus facilisis, nunc in lacinia auctor, eros lacus aliquet velit, quis lobortis risus nunc nec nisi maecans et turpis vitae velit.volutpat porttitor a sit amet est. In eu rutrum ante. Nullam id lorem fermentum, accumsan enim non auctor neque.', 'spicepress',
185 'choice' => 'customizer_repeater_icon',
186 'link' => '#',
187 'open_new_tab' => 'no',
188 ),
189 array(
190 'icon_value' => 'fa fa-mobile',
191 'title' => esc_html__( 'Responsive Design', 'spicepress' ),
192 'text' => 'Phasellus facilisis, nunc in lacinia auctor, eros lacus aliquet velit, quis lobortis risus nunc nec nisi maecans et turpis vitae velit.volutpat porttitor a sit amet est. In eu rutrum ante. Nullam id lorem fermentum, accumsan enim non auctor neque.',
193 'choice' => 'customizer_repeater_icon',
194 'link' => '#',
195 'open_new_tab' => 'no',
196 ),
197 )
198 )
199 );
200 }
201
202 if ( function_exists( 'spiceb_spicepress_service' ) ) {
203 $section_priority = apply_filters( 'spicepress_section_priority', 11, 'spiceb_spicepress_service' );
204 add_action( 'spiceb_spicepress_sections', 'spiceb_spicepress_service', absint( $section_priority ) );
205 }