PluginProbe
SpiceBox / 0.2.4
SpiceBox v0.2.4
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.2.4, at inc/spicepress/sections/spicepress-features-section.php

182 lines 6.6 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 if( ($home_service_section_title) || ($home_service_section_discription)!='' ) { ?>
17 <!-- Section Title -->
18 <section class="service-section">
19 <div class="container">
20 <div class="row">
21 <div class="col-md-12">
22 <div class="section-header">
23 <?php if ( ! empty( $home_service_section_title ) || is_customize_preview() ) : ?>
24 <h1 class="widget-title">
25 <?php echo $home_service_section_title; ?>
26 </h1>
27 <?php endif; ?>
28 <div class="widget-separator"><span></span></div>
29 <?php if($home_service_section_discription) {?>
30 <div class="separator"><span></span></div>
31 <p class="wow fadeInDown animated">
32 <?php echo $home_service_section_discription; ?>
33 </p>
34 <?php } ?>
35 </div>
36 </div>
37 </div>
38 <!-- /Section Title -->
39 <?php }
40 spiceb_spicepress_service_content( $spicepress_service_content );
41 ?>
42 </div>
43 </section>
44 <?php } }
45
46 endif;
47
48
49 function spiceb_spicepress_service_content( $spicepress_service_content, $is_callback = false ) {
50 if ( ! $is_callback ) {
51 ?>
52
53 <?php
54 }
55 if ( ! empty( $spicepress_service_content ) ) :
56
57 $allowed_html = array(
58 'br' => array(),
59 'em' => array(),
60 'strong' => array(),
61 'b' => array(),
62 'i' => array(),
63 );
64
65 $spicepress_service_content = json_decode( $spicepress_service_content );
66 if ( ! empty( $spicepress_service_content ) ) {
67 $i = 1;
68 echo '<div class="row" id="service_content_section">';
69 foreach ( $spicepress_service_content as $service_item ) :
70 $icon = ! empty( $service_item->icon_value ) ? $service_item->icon_value : '';
71 $image = ! empty( $service_item->image_url ) ? $service_item->image_url: '';
72 $title = ! empty( $service_item->title ) ? $service_item->title : '';
73 $text = ! empty( $service_item->text ) ? $service_item->text : '';
74 $link = ! empty( $service_item->link ) ? $service_item->link : '';
75 $color = ! empty( $service_item->color ) ? $service_item->color : '';
76 $choice = ! empty( $service_item->choice ) ? $service_item->choice : 'customizer_repeater_icon';
77 $open_new_tab = ! empty( $service_item->open_new_tab ) ? $service_item->open_new_tab : 'no';
78
79 ?>
80 <div class="col-md-4 col-sm-6 col-xs-12">
81 <div class="post text-center wow flipInX animated" data-wow-delay=".5s">
82
83 <figure class="post-thumbnail">
84 <?php if ( ! empty( $image ) ) : ?>
85
86 <?php if ( ! empty( $link ) ) : ?>
87 <a href="<?php echo esc_url( $link ); ?>" <?php if($open_new_tab == 'yes'){ echo 'target="_blank"';}?>>
88 <?php endif; ?>
89 <img class="services_cols_mn_icon"
90 src="<?php echo esc_url( $image ); ?>" <?php if ( ! empty( $title ) ) : ?> alt="<?php echo esc_attr( $title ); ?>" title="<?php echo esc_attr( $title ); ?>" <?php endif; ?> />
91 <?php if ( ! empty( $link ) ) : ?>
92 </a>
93 <?php endif; ?>
94 <?php endif; ?>
95
96 <?php if ( ! empty( $link ) ) : ?>
97 <a href="<?php echo esc_url( $link ); ?>" <?php if($open_new_tab == 'yes'){ echo 'target="_blank"';}?> >
98 <?php endif; ?>
99 <?php if ( ! empty( $icon ) ) :?>
100
101 <i class="fa <?php echo esc_html( $icon ); ?> txt-pink"></i>
102
103 <?php endif; ?>
104 </figure>
105 <?php if ( ! empty( $title ) ) : ?>
106
107 <div class="entry-header">
108 <h4 class="entry-title"><?php echo esc_html( $title ); ?></h4>
109 </div>
110 <?php endif; ?>
111 <?php if ( ! empty( $link ) ) : ?>
112 </a>
113 <?php endif; ?>
114 <?php if ( ! empty( $text ) ) : ?>
115
116 <div class="entry-content">
117 <p><?php echo wp_kses( html_entity_decode( $text ), $allowed_html ); ?></p>
118 </div>
119
120
121 <?php endif; ?>
122 </div>
123 </div>
124 <?php
125 if ( $i % apply_filters( 'spicepress_service_per_row_no', 3 ) == 0 ) {
126 echo '</div><!-- /.row -->';
127 echo '<div class="row">';
128 }
129 $i++;
130
131 endforeach;
132 echo '</div>';
133 }// End if().
134 endif;
135 if ( ! $is_callback ) {
136 ?>
137
138 <?php
139 }
140 }
141
142 /**
143 * Get default values for service section.
144 *
145 * @since 1.1.31
146 * @access public
147 */
148 function spiceb_spicepress_get_service_default() {
149
150 return apply_filters(
151 'spicepress_service_content', json_encode(
152 array(
153 array(
154 'icon_value' => 'fa-laptop',
155 'title' => esc_html__( 'Easy to Use', 'spicepress' ),
156 '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',
157 'link' => '#',
158 'open_new_tab' => 'no',
159 ),
160 array(
161 'icon_value' => 'fa fa-cogs',
162 'title' => esc_html__( 'Multi-Purpose', 'spicepress' ),
163 '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',
164 'link' => '#',
165 'open_new_tab' => 'no',
166 ),
167 array(
168 'icon_value' => 'fa fa-mobile',
169 'title' => esc_html__( 'Responsive Design', 'spicepress' ),
170 '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.',
171 'link' => '#',
172 'open_new_tab' => 'no',
173 ),
174 )
175 )
176 );
177 }
178
179 if ( function_exists( 'spiceb_spicepress_service' ) ) {
180 $section_priority = apply_filters( 'spicepress_section_priority', 11, 'spiceb_spicepress_service' );
181 add_action( 'spiceb_spicepress_sections', 'spiceb_spicepress_service', absint( $section_priority ) );
182 }