Version Description
- Plugin header i18n
Download this release
Release Info
Developer | nathanrice |
Plugin | Genesis Responsive Slider |
Version | 0.9.5 |
Comparing to | |
See all releases |
Code changes from version 0.9.4 to 0.9.5
- genesis-responsive-slider.php +446 -443
- package.json +1 -1
- readme.txt +80 -77
genesis-responsive-slider.php
CHANGED
@@ -1,444 +1,447 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Plugin Name: Genesis Responsive Slider
|
4 |
-
Plugin URI: http://www.studiopress.com
|
5 |
-
Description: A responsive featured slider for the Genesis Framework.
|
6 |
-
Author: StudioPress
|
7 |
-
Author URI: http://www.studiopress.com
|
8 |
-
|
9 |
-
Version: 0.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 |
-
add_action( '
|
44 |
-
add_action( '
|
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 |
-
.slide-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
}
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
$
|
163 |
-
$
|
164 |
-
|
165 |
-
$
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
if (
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
if ( '
|
240 |
-
$posts_term['0'] = '
|
241 |
-
|
242 |
-
if (
|
243 |
-
$
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
$taxonomy = '
|
254 |
-
|
255 |
-
|
256 |
-
$taxonomy =
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
'
|
290 |
-
'
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
$
|
308 |
-
$
|
309 |
-
$
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
<?php
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
*
|
392 |
-
*
|
393 |
-
* @
|
394 |
-
* @
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
*
|
410 |
-
*
|
411 |
-
* @
|
412 |
-
* @
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
*
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
|
|
|
|
|
|
444 |
}
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Genesis Responsive Slider
|
4 |
+
Plugin URI: http://www.studiopress.com
|
5 |
+
Description: A responsive featured slider for the Genesis Framework.
|
6 |
+
Author: StudioPress
|
7 |
+
Author URI: http://www.studiopress.com
|
8 |
+
|
9 |
+
Version: 0.9.5
|
10 |
+
|
11 |
+
Text Domain: genesis-responsive-slider
|
12 |
+
Domain Path: /languages
|
13 |
+
|
14 |
+
License: GNU General Public License v2.0 (or later)
|
15 |
+
License URI: http://www.opensource.org/licenses/gpl-license.php
|
16 |
+
*/
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Props to Rafal Tomal, Nick Croft, Nathan Rice, Ron Rennick, Josh Byers and Brian Gardner for collaboratively writing this plugin.
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Thanks to Tyler Smith for creating the awesome jquery FlexSlider plugin - http://flex.madebymufffin.com/.
|
24 |
+
*/
|
25 |
+
|
26 |
+
define( 'GENESIS_RESPONSIVE_SLIDER_SETTINGS_FIELD', 'genesis_responsive_slider_settings' );
|
27 |
+
define( 'GENESIS_RESPONSIVE_SLIDER_VERSION', '0.9.5' );
|
28 |
+
|
29 |
+
add_action( 'after_setup_theme', 'GenesisResponsiveSliderInit', 15 );
|
30 |
+
/**
|
31 |
+
* Loads required files and adds image via Genesis Init Hook
|
32 |
+
*/
|
33 |
+
function GenesisResponsiveSliderInit() {
|
34 |
+
|
35 |
+
/** require Genesis */
|
36 |
+
if( ! function_exists( 'genesis_get_option' ) )
|
37 |
+
return;
|
38 |
+
|
39 |
+
// translation support
|
40 |
+
load_plugin_textdomain( 'genesis-responsive-slider', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
|
41 |
+
|
42 |
+
/** hook all frontend slider functions here to ensure Genesis is active **/
|
43 |
+
add_action( 'wp_enqueue_scripts', 'genesis_responsive_slider_scripts' );
|
44 |
+
add_action( 'wp_print_styles', 'genesis_responsive_slider_styles' );
|
45 |
+
add_action( 'wp_head', 'genesis_responsive_slider_head', 1 );
|
46 |
+
add_action( 'wp_footer', 'genesis_responsive_slider_flexslider_params' );
|
47 |
+
add_action( 'widgets_init', 'genesis_responsive_sliderRegister' );
|
48 |
+
|
49 |
+
/** Include Admin file */
|
50 |
+
if ( is_admin() ) require_once( dirname( __FILE__ ) . '/admin.php' );
|
51 |
+
|
52 |
+
/** Add new image size */
|
53 |
+
add_image_size( 'slider', ( int ) genesis_get_responsive_slider_option( 'slideshow_width' ), ( int ) genesis_get_responsive_slider_option( 'slideshow_height' ), TRUE );
|
54 |
+
|
55 |
+
}
|
56 |
+
|
57 |
+
add_action( 'genesis_settings_sanitizer_init', 'genesis_responsive_slider_sanitization' );
|
58 |
+
/**
|
59 |
+
* Add settings to Genesis sanitization
|
60 |
+
*
|
61 |
+
*/
|
62 |
+
function genesis_responsive_slider_sanitization() {
|
63 |
+
genesis_add_option_filter( 'one_zero', GENESIS_RESPONSIVE_SLIDER_SETTINGS_FIELD,
|
64 |
+
array(
|
65 |
+
'slideshow_arrows',
|
66 |
+
'slideshow_excerpt_show',
|
67 |
+
'slideshow_title_show',
|
68 |
+
'slideshow_loop',
|
69 |
+
'slideshow_hide_mobile',
|
70 |
+
'slideshow_no_link',
|
71 |
+
'slideshow_pager'
|
72 |
+
) );
|
73 |
+
genesis_add_option_filter( 'no_html', GENESIS_RESPONSIVE_SLIDER_SETTINGS_FIELD,
|
74 |
+
array(
|
75 |
+
'post_type',
|
76 |
+
'posts_term',
|
77 |
+
'exclude_terms',
|
78 |
+
'include_exclude',
|
79 |
+
'post_id',
|
80 |
+
'posts_num',
|
81 |
+
'posts_offset',
|
82 |
+
'orderby',
|
83 |
+
'slideshow_timer',
|
84 |
+
'slideshow_delay',
|
85 |
+
'slideshow_height',
|
86 |
+
'slideshow_width',
|
87 |
+
'slideshow_effect',
|
88 |
+
'slideshow_excerpt_content',
|
89 |
+
'slideshow_excerpt_content_limit',
|
90 |
+
'slideshow_more_text',
|
91 |
+
'slideshow_excerpt_width',
|
92 |
+
'location_vertical',
|
93 |
+
'location_horizontal',
|
94 |
+
) );
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Load the script files
|
99 |
+
*/
|
100 |
+
function genesis_responsive_slider_scripts() {
|
101 |
+
|
102 |
+
/** easySlider JavaScript code */
|
103 |
+
wp_enqueue_script( 'flexslider', plugins_url('js/jquery.flexslider.js', __FILE__), array( 'jquery' ), GENESIS_RESPONSIVE_SLIDER_VERSION, TRUE );
|
104 |
+
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Load the CSS files
|
109 |
+
*/
|
110 |
+
function genesis_responsive_slider_styles() {
|
111 |
+
|
112 |
+
/** standard slideshow styles */
|
113 |
+
wp_register_style( 'slider_styles', plugins_url('style.css', __FILE__), array(), GENESIS_RESPONSIVE_SLIDER_VERSION );
|
114 |
+
wp_enqueue_style( 'slider_styles' );
|
115 |
+
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Loads scripts and styles via wp_head hook.
|
120 |
+
*/
|
121 |
+
function genesis_responsive_slider_head() {
|
122 |
+
|
123 |
+
$height = ( int ) genesis_get_responsive_slider_option( 'slideshow_height' );
|
124 |
+
$width = ( int ) genesis_get_responsive_slider_option( 'slideshow_width' );
|
125 |
+
|
126 |
+
$slideInfoWidth = ( int ) genesis_get_responsive_slider_option( 'slideshow_excerpt_width' );
|
127 |
+
$slideNavTop = ( int ) ( ($height - 60) * .5 );
|
128 |
+
|
129 |
+
$vertical = genesis_get_responsive_slider_option( 'location_vertical' );
|
130 |
+
$horizontal = genesis_get_responsive_slider_option( 'location_horizontal' );
|
131 |
+
$display = ( genesis_get_responsive_slider_option( 'posts_num' ) >= 2 && genesis_get_responsive_slider_option( 'slideshow_arrows' ) ) ? 'top: ' . $slideNavTop . 'px' : 'display: none';
|
132 |
+
|
133 |
+
$hide_mobile = genesis_get_responsive_slider_option( 'slideshow_hide_mobile' );
|
134 |
+
$slideshow_pager = genesis_get_responsive_slider_option( 'slideshow_pager' );
|
135 |
+
|
136 |
+
echo '
|
137 |
+
<style type="text/css">
|
138 |
+
.slide-excerpt { width: ' . $slideInfoWidth . '%; }
|
139 |
+
.slide-excerpt { ' . $vertical . ': 0; }
|
140 |
+
.slide-excerpt { '. $horizontal . ': 0; }
|
141 |
+
.flexslider { max-width: ' . $width . 'px; max-height: ' . $height . 'px; }
|
142 |
+
.slide-image { max-height: ' . $height . 'px; }
|
143 |
+
</style>';
|
144 |
+
|
145 |
+
if ( $hide_mobile == 1 ) {
|
146 |
+
echo '
|
147 |
+
<style type="text/css">
|
148 |
+
@media only screen
|
149 |
+
and (min-device-width : 320px)
|
150 |
+
and (max-device-width : 480px) {
|
151 |
+
.slide-excerpt { display: none !important; }
|
152 |
+
}
|
153 |
+
</style> ';
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Outputs slider script on wp_footer hook.
|
159 |
+
*/
|
160 |
+
function genesis_responsive_slider_flexslider_params() {
|
161 |
+
|
162 |
+
$timer = ( int ) genesis_get_responsive_slider_option( 'slideshow_timer' );
|
163 |
+
$duration = ( int ) genesis_get_responsive_slider_option( 'slideshow_delay' );
|
164 |
+
$effect = genesis_get_responsive_slider_option( 'slideshow_effect' );
|
165 |
+
$controlnav = genesis_get_responsive_slider_option( 'slideshow_pager' );
|
166 |
+
$directionnav = genesis_get_responsive_slider_option( 'slideshow_arrows' );
|
167 |
+
|
168 |
+
$output = 'jQuery(document).ready(function($) {
|
169 |
+
$(".flexslider").flexslider({
|
170 |
+
controlsContainer: "#genesis-responsive-slider",
|
171 |
+
animation: "' . esc_js( $effect ) . '",
|
172 |
+
directionNav: ' . $directionnav . ',
|
173 |
+
controlNav: ' . $controlnav . ',
|
174 |
+
animationDuration: ' . $duration . ',
|
175 |
+
slideshowSpeed: ' . $timer . '
|
176 |
+
});
|
177 |
+
});';
|
178 |
+
|
179 |
+
$output = str_replace( array( "\n", "\t", "\r" ), '', $output );
|
180 |
+
|
181 |
+
echo '<script type=\'text/javascript\'>' . $output . '</script>';
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Registers the slider widget
|
186 |
+
*/
|
187 |
+
function genesis_responsive_sliderRegister() {
|
188 |
+
register_widget( 'genesis_responsive_sliderWidget' );
|
189 |
+
}
|
190 |
+
|
191 |
+
/** Creates read more link after excerpt */
|
192 |
+
function genesis_responsive_slider_excerpt_more( $more ) {
|
193 |
+
global $post;
|
194 |
+
static $read_more = null;
|
195 |
+
|
196 |
+
if ( $read_more === null )
|
197 |
+
$read_more = genesis_get_responsive_slider_option( 'slideshow_more_text' );
|
198 |
+
|
199 |
+
if ( !$read_more )
|
200 |
+
return '';
|
201 |
+
|
202 |
+
return '… <a href="'. get_permalink( $post->ID ) . '">' . __( $read_more, 'genesis-responsive-slider' ) . '</a>';
|
203 |
+
}
|
204 |
+
|
205 |
+
/**
|
206 |
+
* Slideshow Widget Class
|
207 |
+
*/
|
208 |
+
class genesis_responsive_sliderWidget extends WP_Widget {
|
209 |
+
|
210 |
+
function __construct() {
|
211 |
+
$widget_ops = array( 'classname' => 'genesis_responsive_slider', 'description' => __( 'Displays a slideshow inside a widget area', 'genesis-responsive-slider' ) );
|
212 |
+
$control_ops = array( 'width' => 200, 'height' => 250, 'id_base' => 'genesisresponsiveslider-widget' );
|
213 |
+
parent::__construct( 'genesisresponsiveslider-widget', __( 'Genesis - Responsive Slider', 'genesis-responsive-slider' ), $widget_ops, $control_ops );
|
214 |
+
}
|
215 |
+
|
216 |
+
function save_settings( $settings ) {
|
217 |
+
$settings['_multiwidget'] = 0;
|
218 |
+
update_option( $this->option_name, $settings );
|
219 |
+
}
|
220 |
+
|
221 |
+
// display widget
|
222 |
+
function widget( $args, $instance ) {
|
223 |
+
extract( $args );
|
224 |
+
|
225 |
+
echo $before_widget;
|
226 |
+
|
227 |
+
$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
|
228 |
+
if ( $title )
|
229 |
+
echo $before_title . $title . $after_title;
|
230 |
+
|
231 |
+
$term_args = array( );
|
232 |
+
|
233 |
+
if ( 'page' != genesis_get_responsive_slider_option( 'post_type' ) ) {
|
234 |
+
|
235 |
+
if ( genesis_get_responsive_slider_option( 'posts_term' ) ) {
|
236 |
+
|
237 |
+
$posts_term = explode( ',', genesis_get_responsive_slider_option( 'posts_term' ) );
|
238 |
+
|
239 |
+
if ( 'category' == $posts_term['0'] )
|
240 |
+
$posts_term['0'] = 'category_name';
|
241 |
+
|
242 |
+
if ( 'post_tag' == $posts_term['0'] )
|
243 |
+
$posts_term['0'] = 'tag';
|
244 |
+
|
245 |
+
if ( isset( $posts_term['1'] ) )
|
246 |
+
$term_args[$posts_term['0']] = $posts_term['1'];
|
247 |
+
|
248 |
+
}
|
249 |
+
|
250 |
+
if ( !empty( $posts_term['0'] ) ) {
|
251 |
+
|
252 |
+
if ( 'category' == $posts_term['0'] )
|
253 |
+
$taxonomy = 'category';
|
254 |
+
|
255 |
+
elseif ( 'post_tag' == $posts_term['0'] )
|
256 |
+
$taxonomy = 'post_tag';
|
257 |
+
|
258 |
+
else
|
259 |
+
$taxonomy = $posts_term['0'];
|
260 |
+
|
261 |
+
} else {
|
262 |
+
|
263 |
+
$taxonomy = 'category';
|
264 |
+
|
265 |
+
}
|
266 |
+
|
267 |
+
if ( genesis_get_responsive_slider_option( 'exclude_terms' ) ) {
|
268 |
+
|
269 |
+
$exclude_terms = explode( ',', str_replace( ' ', '', genesis_get_responsive_slider_option( 'exclude_terms' ) ) );
|
270 |
+
$term_args[$taxonomy . '__not_in'] = $exclude_terms;
|
271 |
+
|
272 |
+
}
|
273 |
+
}
|
274 |
+
|
275 |
+
if ( genesis_get_responsive_slider_option( 'posts_offset' ) ) {
|
276 |
+
$myOffset = genesis_get_responsive_slider_option( 'posts_offset' );
|
277 |
+
$term_args['offset'] = $myOffset;
|
278 |
+
}
|
279 |
+
|
280 |
+
if ( genesis_get_responsive_slider_option( 'post_id' ) ) {
|
281 |
+
$IDs = explode( ',', str_replace( ' ', '', genesis_get_responsive_slider_option( 'post_id' ) ) );
|
282 |
+
if ( 'include' == genesis_get_responsive_slider_option( 'include_exclude' ) )
|
283 |
+
$term_args['post__in'] = $IDs;
|
284 |
+
else
|
285 |
+
$term_args['post__not_in'] = $IDs;
|
286 |
+
}
|
287 |
+
|
288 |
+
$query_args = array_merge( $term_args, array(
|
289 |
+
'post_type' => genesis_get_responsive_slider_option( 'post_type' ),
|
290 |
+
'posts_per_page' => genesis_get_responsive_slider_option( 'posts_num' ),
|
291 |
+
'orderby' => genesis_get_responsive_slider_option( 'orderby' ),
|
292 |
+
'order' => genesis_get_responsive_slider_option( 'order' ),
|
293 |
+
'meta_key' => genesis_get_responsive_slider_option( 'meta_key' )
|
294 |
+
) );
|
295 |
+
|
296 |
+
$query_args = apply_filters( 'genesis_responsive_slider_query_args', $query_args );
|
297 |
+
add_filter( 'excerpt_more', 'genesis_responsive_slider_excerpt_more' );
|
298 |
+
|
299 |
+
?>
|
300 |
+
|
301 |
+
<div id="genesis-responsive-slider">
|
302 |
+
<div class="flexslider">
|
303 |
+
<ul class="slides">
|
304 |
+
<?php
|
305 |
+
$slider_posts = new WP_Query( $query_args );
|
306 |
+
if ( $slider_posts->have_posts() ) {
|
307 |
+
$show_excerpt = genesis_get_responsive_slider_option( 'slideshow_excerpt_show' );
|
308 |
+
$show_title = genesis_get_responsive_slider_option( 'slideshow_title_show' );
|
309 |
+
$show_type = genesis_get_responsive_slider_option( 'slideshow_excerpt_content' );
|
310 |
+
$show_limit = genesis_get_responsive_slider_option( 'slideshow_excerpt_content_limit' );
|
311 |
+
$more_text = genesis_get_responsive_slider_option( 'slideshow_more_text' );
|
312 |
+
$no_image_link = genesis_get_responsive_slider_option( 'slideshow_no_link' );
|
313 |
+
}
|
314 |
+
while ( $slider_posts->have_posts() ) : $slider_posts->the_post();
|
315 |
+
?>
|
316 |
+
<li>
|
317 |
+
|
318 |
+
<?php if ( $show_excerpt == 1 || $show_title == 1 ) { ?>
|
319 |
+
<div class="slide-excerpt slide-<?php the_ID(); ?>">
|
320 |
+
<div class="slide-background"></div><!-- end .slide-background -->
|
321 |
+
<div class="slide-excerpt-border ">
|
322 |
+
<?php
|
323 |
+
if ( $show_title == 1 ) {
|
324 |
+
?>
|
325 |
+
<h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
|
326 |
+
<?php
|
327 |
+
}
|
328 |
+
if ( $show_excerpt ) {
|
329 |
+
if ( $show_type != 'full' )
|
330 |
+
the_excerpt();
|
331 |
+
elseif ( $show_limit )
|
332 |
+
the_content_limit( (int)$show_limit, esc_html( $more_text ) );
|
333 |
+
else
|
334 |
+
the_content( esc_html( $more_text ) );
|
335 |
+
}
|
336 |
+
?>
|
337 |
+
</div><!-- end .slide-excerpt-border -->
|
338 |
+
</div><!-- end .slide-excerpt -->
|
339 |
+
<?php } ?>
|
340 |
+
|
341 |
+
<div class="slide-image">
|
342 |
+
<?php
|
343 |
+
if ( $no_image_link ) {
|
344 |
+
?>
|
345 |
+
<img src="<?php genesis_image( 'format=url&size=slider' ); ?>" alt="<?php the_title(); ?>" />
|
346 |
+
<?php
|
347 |
+
} else {
|
348 |
+
?>
|
349 |
+
<a href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php genesis_image( 'format=url&size=slider' ); ?>" alt="<?php the_title(); ?>" /></a>
|
350 |
+
<?php
|
351 |
+
|
352 |
+
} // $no_image_link
|
353 |
+
?>
|
354 |
+
</div><!-- end .slide-image -->
|
355 |
+
|
356 |
+
</li>
|
357 |
+
<?php endwhile; ?>
|
358 |
+
</ul><!-- end ul.slides -->
|
359 |
+
</div><!-- end .flexslider -->
|
360 |
+
</div><!-- end #genesis-responsive-slider -->
|
361 |
+
|
362 |
+
<?php
|
363 |
+
echo $after_widget;
|
364 |
+
wp_reset_query();
|
365 |
+
remove_filter( 'excerpt_more', 'genesis_responsive_slider_excerpt_more' );
|
366 |
+
|
367 |
+
}
|
368 |
+
|
369 |
+
/** Widget options */
|
370 |
+
function form( $instance ) {
|
371 |
+
$instance = wp_parse_args( (array) $instance, array( 'title' => '') );
|
372 |
+
$title = $instance['title'];
|
373 |
+
?>
|
374 |
+
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'genesis-responsive-slider' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></label></p>
|
375 |
+
<?php
|
376 |
+
echo '<p>';
|
377 |
+
printf( __( 'To configure slider options, please go to the <a href="%s">Slider Settings</a> page.', 'genesis-responsive-slider' ), menu_page_url( 'genesis_responsive_slider', 0 ) );
|
378 |
+
echo '</p>';
|
379 |
+
}
|
380 |
+
|
381 |
+
function update( $new_instance, $old_instance ) {
|
382 |
+
$instance = $old_instance;
|
383 |
+
$new_instance = wp_parse_args( (array) $new_instance, array( 'title' => '' ) );
|
384 |
+
$instance['title'] = strip_tags( $new_instance['title'] );
|
385 |
+
return $instance;
|
386 |
+
}
|
387 |
+
|
388 |
+
}
|
389 |
+
|
390 |
+
/**
|
391 |
+
* Used to exclude taxonomies and related terms from list of available terms/taxonomies in widget form().
|
392 |
+
*
|
393 |
+
* @since 0.9
|
394 |
+
* @author Nick Croft
|
395 |
+
*
|
396 |
+
* @param string $taxonomy 'taxonomy' being tested
|
397 |
+
* @return string
|
398 |
+
*/
|
399 |
+
function genesis_responsive_slider_exclude_taxonomies( $taxonomy ) {
|
400 |
+
|
401 |
+
$filters = array( '', 'nav_menu' );
|
402 |
+
$filters = apply_filters( 'genesis_responsive_slider_exclude_taxonomies', $filters );
|
403 |
+
|
404 |
+
return ( ! in_array( $taxonomy->name, $filters ) );
|
405 |
+
|
406 |
+
}
|
407 |
+
|
408 |
+
/**
|
409 |
+
* Used to exclude post types from list of available post_types in widget form().
|
410 |
+
*
|
411 |
+
* @since 0.9
|
412 |
+
* @author Nick Croft
|
413 |
+
*
|
414 |
+
* @param string $type 'post_type' being tested
|
415 |
+
* @return string
|
416 |
+
*/
|
417 |
+
function genesis_responsive_slider_exclude_post_types( $type ) {
|
418 |
+
|
419 |
+
$filters = array( '', 'attachment' );
|
420 |
+
$filters = apply_filters( 'genesis_responsive_slider_exclude_post_types', $filters );
|
421 |
+
|
422 |
+
return ( ! in_array( $type, $filters ) );
|
423 |
+
|
424 |
+
}
|
425 |
+
|
426 |
+
/**
|
427 |
+
* Returns Slider Option
|
428 |
+
*
|
429 |
+
* @param string $key key value for option
|
430 |
+
* @return string
|
431 |
+
*/
|
432 |
+
function genesis_get_responsive_slider_option( $key ) {
|
433 |
+
return genesis_get_option( $key, GENESIS_RESPONSIVE_SLIDER_SETTINGS_FIELD );
|
434 |
+
}
|
435 |
+
|
436 |
+
/**
|
437 |
+
* Echos Slider Option
|
438 |
+
*
|
439 |
+
* @param string $key key value for option
|
440 |
+
*/
|
441 |
+
function genesis_responsive_slider_option( $key ) {
|
442 |
+
|
443 |
+
if ( ! genesis_get_responsive_slider_option( $key ) )
|
444 |
+
return false;
|
445 |
+
|
446 |
+
echo genesis_get_responsive_slider_option( $key );
|
447 |
}
|
package.json
CHANGED
@@ -29,7 +29,7 @@
|
|
29 |
"description": "A responsive featured slider for the Genesis Framework.",
|
30 |
"author": "StudioPress",
|
31 |
"authoruri": "http://www.studiopress.com/",
|
32 |
-
"version": "0.9.
|
33 |
"license": "GPL-2.0+",
|
34 |
"licenseuri": "http://www.gnu.org/licenses/gpl-2.0.html",
|
35 |
"textdomain": "genesis-simple-share"
|
29 |
"description": "A responsive featured slider for the Genesis Framework.",
|
30 |
"author": "StudioPress",
|
31 |
"authoruri": "http://www.studiopress.com/",
|
32 |
+
"version": "0.9.5",
|
33 |
"license": "GPL-2.0+",
|
34 |
"licenseuri": "http://www.gnu.org/licenses/gpl-2.0.html",
|
35 |
"textdomain": "genesis-simple-share"
|
readme.txt
CHANGED
@@ -1,84 +1,87 @@
|
|
1 |
-
=== Genesis Responsive Slider ===
|
2 |
-
Contributors: nathanrice, studiopress, wpmuguru
|
3 |
-
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5553118
|
4 |
-
Tags: slider, slideshow, responsive, genesis, genesiswp, studiopress
|
5 |
-
Requires at least: 3.2
|
6 |
-
Tested up to: 4.3.1
|
7 |
-
Stable tag: 0.9.
|
8 |
-
|
9 |
-
This plugin allows you to create a simple responsive slider that displays the featured image, along with the title and excerpt from each post.
|
10 |
-
|
11 |
-
== Description ==
|
12 |
-
|
13 |
-
This plugin allows you to create a simple responsive slider that displays the featured image, along with the title and excerpt from each post.
|
14 |
-
|
15 |
-
It includes options for the maximum dimensions of your slideshow, allows you to choose to display posts or pages, what category to pull from, and even the specific post IDs of the posts you want to display. It includes next/previous arrows and a pager along with the option to turn both on or off. Finally, you can place the slider into a widget area.
|
16 |
-
|
17 |
-
The slideshow is also responsive and will automatically adjust for the screen it is being displayed on.
|
18 |
-
|
19 |
-
Note: This plugin only supports Genesis child themes.
|
20 |
-
|
21 |
-
== Installation ==
|
22 |
-
|
23 |
-
1. Upload the entire `genesis-responsive-slider` folder to the `/wp-content/plugins/` directory
|
24 |
-
1. DO NOT change the name of the `genesis-responsive-slider` folder
|
25 |
-
1. Activate the plugin through the 'Plugins' menu in WordPress
|
26 |
-
1. Navigate to the `Genesis > Slider Settings` menu
|
27 |
-
1. Configure the slider
|
28 |
-
1. In the "Widgets" screen, drag the "Genesis Responsive Slider" widget to the widget area of your choice
|
29 |
-
|
30 |
-
== Child Theme Integration ==
|
31 |
-
|
32 |
-
To adjust the slider defaults for a child theme use a filter simiar to the following:
|
33 |
-
|
34 |
-
`add_filter( 'genesis_responsive_slider_settings_defaults', 'my_child_theme_responsive_slider_defaults' );
|
35 |
-
|
36 |
-
function my_child_theme_responsive_slider_defaults( $defaults ) {
|
37 |
-
$defaults = array(
|
38 |
-
'post_type' => 'post',
|
39 |
-
'posts_term' => '',
|
40 |
-
'exclude_terms' => '',
|
41 |
-
'include_exclude' => '',
|
42 |
-
'post_id' => '',
|
43 |
-
'posts_num' => 5,
|
44 |
-
'posts_offset' => 0,
|
45 |
-
'orderby' => 'date',
|
46 |
-
'slideshow_timer' => 4000,
|
47 |
-
'slideshow_delay' => 800,
|
48 |
-
'slideshow_arrows' => 1,
|
49 |
-
'slideshow_pager' => 1,
|
50 |
-
'slideshow_loop' => 1,
|
51 |
-
'slideshow_height' => 400,
|
52 |
-
'slideshow_width' => 920,
|
53 |
-
'slideshow_effect' => 'slide',
|
54 |
-
'slideshow_excerpt_content' => 'excerpts',
|
55 |
-
'slideshow_excerpt_content_limit' => 150,
|
56 |
-
'slideshow_more_text' => '[Continue Reading]',
|
57 |
-
'slideshow_excerpt_show' => 1,
|
58 |
-
'slideshow_excerpt_width' => 50,
|
59 |
-
'location_vertical' => 'bottom',
|
60 |
-
'location_horizontal' => 'right',
|
61 |
-
'slideshow_hide_mobile' => 1
|
62 |
-
);
|
63 |
-
return $defaults;
|
64 |
-
}
|
65 |
-
`
|
66 |
-
|
67 |
-
== Changelog ==
|
|
|
|
|
|
|
68 |
|
69 |
= 0.9.4 =
|
70 |
* Update POT file.
|
71 |
|
72 |
-
= 0.9.2 =
|
73 |
-
* add alt attribute to images for validation
|
74 |
* Fix image links
|
75 |
|
76 |
-
= 0.9.1 =
|
77 |
-
* Fix slider HTML markup for validation
|
78 |
-
* Fix SSL mixed cotent warning
|
79 |
-
* Add setting to turn off image links
|
80 |
-
* Fix Excerpt More filter to only apply to slides
|
81 |
* UI text changes
|
82 |
-
|
83 |
-
= 0.9.0 =
|
84 |
-
* Beta Release
|
1 |
+
=== Genesis Responsive Slider ===
|
2 |
+
Contributors: nathanrice, studiopress, wpmuguru
|
3 |
+
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5553118
|
4 |
+
Tags: slider, slideshow, responsive, genesis, genesiswp, studiopress
|
5 |
+
Requires at least: 3.2
|
6 |
+
Tested up to: 4.3.1
|
7 |
+
Stable tag: 0.9.5
|
8 |
+
|
9 |
+
This plugin allows you to create a simple responsive slider that displays the featured image, along with the title and excerpt from each post.
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
|
13 |
+
This plugin allows you to create a simple responsive slider that displays the featured image, along with the title and excerpt from each post.
|
14 |
+
|
15 |
+
It includes options for the maximum dimensions of your slideshow, allows you to choose to display posts or pages, what category to pull from, and even the specific post IDs of the posts you want to display. It includes next/previous arrows and a pager along with the option to turn both on or off. Finally, you can place the slider into a widget area.
|
16 |
+
|
17 |
+
The slideshow is also responsive and will automatically adjust for the screen it is being displayed on.
|
18 |
+
|
19 |
+
Note: This plugin only supports Genesis child themes.
|
20 |
+
|
21 |
+
== Installation ==
|
22 |
+
|
23 |
+
1. Upload the entire `genesis-responsive-slider` folder to the `/wp-content/plugins/` directory
|
24 |
+
1. DO NOT change the name of the `genesis-responsive-slider` folder
|
25 |
+
1. Activate the plugin through the 'Plugins' menu in WordPress
|
26 |
+
1. Navigate to the `Genesis > Slider Settings` menu
|
27 |
+
1. Configure the slider
|
28 |
+
1. In the "Widgets" screen, drag the "Genesis Responsive Slider" widget to the widget area of your choice
|
29 |
+
|
30 |
+
== Child Theme Integration ==
|
31 |
+
|
32 |
+
To adjust the slider defaults for a child theme use a filter simiar to the following:
|
33 |
+
|
34 |
+
`add_filter( 'genesis_responsive_slider_settings_defaults', 'my_child_theme_responsive_slider_defaults' );
|
35 |
+
|
36 |
+
function my_child_theme_responsive_slider_defaults( $defaults ) {
|
37 |
+
$defaults = array(
|
38 |
+
'post_type' => 'post',
|
39 |
+
'posts_term' => '',
|
40 |
+
'exclude_terms' => '',
|
41 |
+
'include_exclude' => '',
|
42 |
+
'post_id' => '',
|
43 |
+
'posts_num' => 5,
|
44 |
+
'posts_offset' => 0,
|
45 |
+
'orderby' => 'date',
|
46 |
+
'slideshow_timer' => 4000,
|
47 |
+
'slideshow_delay' => 800,
|
48 |
+
'slideshow_arrows' => 1,
|
49 |
+
'slideshow_pager' => 1,
|
50 |
+
'slideshow_loop' => 1,
|
51 |
+
'slideshow_height' => 400,
|
52 |
+
'slideshow_width' => 920,
|
53 |
+
'slideshow_effect' => 'slide',
|
54 |
+
'slideshow_excerpt_content' => 'excerpts',
|
55 |
+
'slideshow_excerpt_content_limit' => 150,
|
56 |
+
'slideshow_more_text' => '[Continue Reading]',
|
57 |
+
'slideshow_excerpt_show' => 1,
|
58 |
+
'slideshow_excerpt_width' => 50,
|
59 |
+
'location_vertical' => 'bottom',
|
60 |
+
'location_horizontal' => 'right',
|
61 |
+
'slideshow_hide_mobile' => 1
|
62 |
+
);
|
63 |
+
return $defaults;
|
64 |
+
}
|
65 |
+
`
|
66 |
+
|
67 |
+
== Changelog ==
|
68 |
+
|
69 |
+
= 0.9.5 =
|
70 |
+
* Plugin header i18n
|
71 |
|
72 |
= 0.9.4 =
|
73 |
* Update POT file.
|
74 |
|
75 |
+
= 0.9.2 =
|
76 |
+
* add alt attribute to images for validation
|
77 |
* Fix image links
|
78 |
|
79 |
+
= 0.9.1 =
|
80 |
+
* Fix slider HTML markup for validation
|
81 |
+
* Fix SSL mixed cotent warning
|
82 |
+
* Add setting to turn off image links
|
83 |
+
* Fix Excerpt More filter to only apply to slides
|
84 |
* UI text changes
|
85 |
+
|
86 |
+
= 0.9.0 =
|
87 |
+
* Beta Release
|