Version Description
- Moved inline styling to footer
- Fixed responsive styling issue on about page
- Added widget HTML wrapper for better compatibility with themes
- Added get_sliders_list() function for custom theme integration
- Improved 'No slides' message to link to slider management / sample slider loader.
- Corrected slider selection label in slider metabox
- Corrected insert slider window to display 'no slider available' message when there are no sliders
- Fixed missing closing bracked in template code example
- Fixed slider image tag to only be outputted when an image was defined
- Improved contrained slider layout
- Fixed missing insert slider icon in TinyMCE editor
Download this release
Release Info
Developer | Cryout Creations |
Plugin | Serious Slider |
Version | 0.5.1 |
Comparing to | |
See all releases |
Code changes from version 0.5 to 0.5.1
- cryout-serious-slider.php +30 -12
- inc/right-column.php +1 -1
- inc/shortcodes.php +64 -44
- inc/slider.php +77 -0
- inc/widgets.php +2 -0
- readme.txt +16 -3
- resources/backend.css +1 -2
- resources/style.css +7 -13
cryout-serious-slider.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Cryout Serious Slider
|
4 |
Plugin URI: http://www.cryoutcreations.eu/serious-slider
|
5 |
Description: Responsive slider, built on Bootstrap Carousel, uses core WordPress functionality, easy to use, seriously.
|
6 |
-
Version: 0.5
|
7 |
Author: Cryout Creations
|
8 |
Author URI: http://www.cryoutcreations.eu
|
9 |
License: GPLv3
|
@@ -12,16 +12,18 @@
|
|
12 |
|
13 |
class Cryout_Serious_Slider {
|
14 |
|
15 |
-
public $version = "0.5";
|
16 |
public $options = array();
|
17 |
public $shortcode_tag = 'serious-slider';
|
|
|
18 |
|
19 |
public $slug = 'cryout-serious-slider';
|
20 |
-
public $posttype = 'cryout_serious_slide';
|
21 |
public $taxonomy = 'cryout_serious_slider_category';
|
22 |
private $title = '';
|
23 |
private $thepage = '';
|
24 |
private $aboutpage = '';
|
|
|
25 |
public $defaults = array(
|
26 |
'cryout_serious_slider_sort' => 'date', // date, order
|
27 |
'cryout_serious_slider_sizing' => 0, // 1 = force slider size
|
@@ -52,6 +54,7 @@ class Cryout_Serious_Slider {
|
|
52 |
|
53 |
$this->title = __( 'Serious Slider', 'cryout-serious-slider' );
|
54 |
$this->aboutpage = 'edit.php?post_type=' . $this->posttype . '&page=' . $this->slug . '-about';
|
|
|
55 |
|
56 |
//$this->options = $this->get_settings();
|
57 |
|
@@ -110,7 +113,7 @@ class Cryout_Serious_Slider {
|
|
110 |
* translation domain
|
111 |
***********************/
|
112 |
function load_textdomain() {
|
113 |
-
load_plugin_textdomain( 'cryout-
|
114 |
}
|
115 |
|
116 |
|
@@ -123,7 +126,8 @@ class Cryout_Serious_Slider {
|
|
123 |
} // enqueue_scripts()
|
124 |
|
125 |
public function enqueue_styles() {
|
126 |
-
|
|
|
127 |
} // enqueue_styles()
|
128 |
|
129 |
|
@@ -148,7 +152,7 @@ class Cryout_Serious_Slider {
|
|
148 |
|
149 |
// add plugin actions links
|
150 |
public function actions_links( $links ) {
|
151 |
-
array_unshift( $links, '<a href="' . $this->aboutpage . '">' . __( 'About Plugin', '
|
152 |
return $links;
|
153 |
}
|
154 |
|
@@ -217,9 +221,23 @@ class Cryout_Serious_Slider {
|
|
217 |
foreach ($data as $slider) {
|
218 |
$sliders[] = array('text'=>$slider->name, 'value'=>$slider->term_id);
|
219 |
}
|
|
|
|
|
|
|
220 |
return $sliders;
|
221 |
} // get_sliders()
|
222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
/* customize taxonomy selection box in add slide window */
|
224 |
function custom_category_picker( $post, $box ) {
|
225 |
$defaults = array( 'taxonomy' => 'category' );
|
@@ -245,7 +263,7 @@ class Cryout_Serious_Slider {
|
|
245 |
'orderby' => 'name',
|
246 |
'selected' => $this->get_slide_slider( $post->ID ),
|
247 |
'hierarchical' => 0,
|
248 |
-
'show_option_none' => '— ' .
|
249 |
);
|
250 |
|
251 |
wp_dropdown_categories( $cat_dropdown_args );
|
@@ -294,7 +312,7 @@ class Cryout_Serious_Slider {
|
|
294 |
'all_items' => __( 'All Slides', 'cryout-serious-slider' ),
|
295 |
'search_items' => __( 'Search Slide', 'cryout-serious-slider' ),
|
296 |
'parent_item_colon' => __( 'Parent Slides:', 'cryout-serious-slider' ),
|
297 |
-
'not_found' => __( 'No slides found.', 'cryout-serious-slider' ),
|
298 |
'not_found_in_trash' => __( 'No slides found in Trash.', 'cryout-serious-slider' )
|
299 |
),
|
300 |
'taxonomies' => array(
|
@@ -304,7 +322,7 @@ class Cryout_Serious_Slider {
|
|
304 |
);
|
305 |
|
306 |
/* Register the post type. */
|
307 |
-
register_post_type(
|
308 |
|
309 |
} // register_post_types()
|
310 |
|
@@ -440,7 +458,7 @@ class Cryout_Serious_Slider {
|
|
440 |
if (!empty($_GET[$tax_slug])) $filtered_tax = sanitize_text_field($_GET[$tax_slug]); else $filtered_tax = '';
|
441 |
if(count($terms) > 0) {
|
442 |
echo "<select name='$tax_slug' id='filter_$tax_slug' class='postform'>";
|
443 |
-
printf( "<option value=''>%s</option>", sprintf( _x('
|
444 |
foreach ($terms as $term) {
|
445 |
echo '<option value='. $term->slug, $filtered_tax == $term->slug ? ' selected="selected"' : '','>' . $term->name .' (' . $term->count .')</option>';
|
446 |
}
|
@@ -579,12 +597,12 @@ class Cryout_Serious_Slider {
|
|
579 |
} // admin_head()
|
580 |
|
581 |
function register_mce_external_plugins( $plugin_array ) {
|
582 |
-
$plugin_array[$this->
|
583 |
return $plugin_array;
|
584 |
} // register_mce_external_plugins()
|
585 |
|
586 |
function regiter_mce_buttons( $buttons ) {
|
587 |
-
array_push( $buttons, $this->
|
588 |
return $buttons;
|
589 |
} // regiter_mce_buttons()
|
590 |
|
3 |
Plugin Name: Cryout Serious Slider
|
4 |
Plugin URI: http://www.cryoutcreations.eu/serious-slider
|
5 |
Description: Responsive slider, built on Bootstrap Carousel, uses core WordPress functionality, easy to use, seriously.
|
6 |
+
Version: 0.5.1
|
7 |
Author: Cryout Creations
|
8 |
Author URI: http://www.cryoutcreations.eu
|
9 |
License: GPLv3
|
12 |
|
13 |
class Cryout_Serious_Slider {
|
14 |
|
15 |
+
public $version = "0.5.1";
|
16 |
public $options = array();
|
17 |
public $shortcode_tag = 'serious-slider';
|
18 |
+
public $mce_tag = 'serious_slider';
|
19 |
|
20 |
public $slug = 'cryout-serious-slider';
|
21 |
+
public $posttype = 'cryout_serious_slide'; // 20 chars!
|
22 |
public $taxonomy = 'cryout_serious_slider_category';
|
23 |
private $title = '';
|
24 |
private $thepage = '';
|
25 |
private $aboutpage = '';
|
26 |
+
private $addnewpage = '';
|
27 |
public $defaults = array(
|
28 |
'cryout_serious_slider_sort' => 'date', // date, order
|
29 |
'cryout_serious_slider_sizing' => 0, // 1 = force slider size
|
54 |
|
55 |
$this->title = __( 'Serious Slider', 'cryout-serious-slider' );
|
56 |
$this->aboutpage = 'edit.php?post_type=' . $this->posttype . '&page=' . $this->slug . '-about';
|
57 |
+
$this->addnewpage = 'post-new.php?post_type=' . $this->posttype;
|
58 |
|
59 |
//$this->options = $this->get_settings();
|
60 |
|
113 |
* translation domain
|
114 |
***********************/
|
115 |
function load_textdomain() {
|
116 |
+
load_plugin_textdomain( 'cryout-serious-slider', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
|
117 |
}
|
118 |
|
119 |
|
126 |
} // enqueue_scripts()
|
127 |
|
128 |
public function enqueue_styles() {
|
129 |
+
wp_register_style( 'cryout-serious-slider-style', plugins_url( 'resources/style.css', __FILE__ ), NULL, $this->version );
|
130 |
+
wp_enqueue_style( 'cryout-serious-slider-style' );
|
131 |
} // enqueue_styles()
|
132 |
|
133 |
|
152 |
|
153 |
// add plugin actions links
|
154 |
public function actions_links( $links ) {
|
155 |
+
array_unshift( $links, '<a href="' . $this->aboutpage . '">' . __( 'About Plugin', 'cryout-serious-slider' ) . '</a>' );
|
156 |
return $links;
|
157 |
}
|
158 |
|
221 |
foreach ($data as $slider) {
|
222 |
$sliders[] = array('text'=>$slider->name, 'value'=>$slider->term_id);
|
223 |
}
|
224 |
+
|
225 |
+
if (count($sliders)<1) $sliders = array( array('text' => __('No sliders available. Create a slider first...', 'cryout-serious-slider'), 'value' => 0) );
|
226 |
+
|
227 |
return $sliders;
|
228 |
} // get_sliders()
|
229 |
|
230 |
+
// theme compatibility function
|
231 |
+
public function get_sliders_list() {
|
232 |
+
$data = get_terms( $this->taxonomy, array( 'hide_empty' => false ) );
|
233 |
+
|
234 |
+
$sliders = array();
|
235 |
+
foreach ($data as $slider) {
|
236 |
+
$sliders[$slider->term_id] = $slider->name;
|
237 |
+
}
|
238 |
+
return $sliders;
|
239 |
+
} // get_sliders_list()
|
240 |
+
|
241 |
/* customize taxonomy selection box in add slide window */
|
242 |
function custom_category_picker( $post, $box ) {
|
243 |
$defaults = array( 'taxonomy' => 'category' );
|
263 |
'orderby' => 'name',
|
264 |
'selected' => $this->get_slide_slider( $post->ID ),
|
265 |
'hierarchical' => 0,
|
266 |
+
'show_option_none' => '— ' . __('Select slider', 'cryout-serious-slider') . ' —',
|
267 |
);
|
268 |
|
269 |
wp_dropdown_categories( $cat_dropdown_args );
|
312 |
'all_items' => __( 'All Slides', 'cryout-serious-slider' ),
|
313 |
'search_items' => __( 'Search Slide', 'cryout-serious-slider' ),
|
314 |
'parent_item_colon' => __( 'Parent Slides:', 'cryout-serious-slider' ),
|
315 |
+
'not_found' => sprintf( __( 'No slides found. Go ahead and add <a href="%1$s">add some</a> or <a href="%2$s">load sample content</a>.', 'cryout-serious-slider' ), $this->addnewpage, $this->aboutpage ),
|
316 |
'not_found_in_trash' => __( 'No slides found in Trash.', 'cryout-serious-slider' )
|
317 |
),
|
318 |
'taxonomies' => array(
|
322 |
);
|
323 |
|
324 |
/* Register the post type. */
|
325 |
+
register_post_type( $this->posttype, $args );
|
326 |
|
327 |
} // register_post_types()
|
328 |
|
458 |
if (!empty($_GET[$tax_slug])) $filtered_tax = sanitize_text_field($_GET[$tax_slug]); else $filtered_tax = '';
|
459 |
if(count($terms) > 0) {
|
460 |
echo "<select name='$tax_slug' id='filter_$tax_slug' class='postform'>";
|
461 |
+
printf( "<option value=''>%s</option>", sprintf( _x('Select %s', 'select terms', 'cryout-serious-slider'), $tax_name ) );
|
462 |
foreach ($terms as $term) {
|
463 |
echo '<option value='. $term->slug, $filtered_tax == $term->slug ? ' selected="selected"' : '','>' . $term->name .' (' . $term->count .')</option>';
|
464 |
}
|
597 |
} // admin_head()
|
598 |
|
599 |
function register_mce_external_plugins( $plugin_array ) {
|
600 |
+
$plugin_array[$this->mce_tag] = plugins_url( 'resources/mce-button.js' , __FILE__ );
|
601 |
return $plugin_array;
|
602 |
} // register_mce_external_plugins()
|
603 |
|
604 |
function regiter_mce_buttons( $buttons ) {
|
605 |
+
array_push( $buttons, $this->mce_tag );
|
606 |
return $buttons;
|
607 |
} // regiter_mce_buttons()
|
608 |
|
inc/right-column.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
<br><hr>
|
10 |
<h3><?php _e('Template', 'cryout-serious-slider') ?></h3>
|
11 |
<p><?php _e('Use the PHP code to include the slider directly in files', 'cryout-serious-slider') ?></p>
|
12 |
-
<textarea readonly="readonly" rows="3"><?php printf( "<?php\n echo do_shortcode( '[serious-slider id=%s' );\n ?>", $term_ID ) ?></textarea>
|
13 |
</div>
|
14 |
</div>
|
15 |
</div>
|
9 |
<br><hr>
|
10 |
<h3><?php _e('Template', 'cryout-serious-slider') ?></h3>
|
11 |
<p><?php _e('Use the PHP code to include the slider directly in files', 'cryout-serious-slider') ?></p>
|
12 |
+
<textarea readonly="readonly" rows="3"><?php printf( "<?php\n echo do_shortcode( '[serious-slider id=%s]' );\n ?>", $term_ID ) ?></textarea>
|
13 |
</div>
|
14 |
</div>
|
15 |
</div>
|
inc/shortcodes.php
CHANGED
@@ -4,12 +4,39 @@
|
|
4 |
class Cryout_Serious_Slider_Shortcode {
|
5 |
|
6 |
public $shortcode_tag = 'serious-slider';
|
|
|
|
|
7 |
|
8 |
function __construct($args = array()){
|
9 |
//register shortcode
|
10 |
add_shortcode( $this->shortcode_tag, array( $this, 'shortcode_render' ) );
|
11 |
}
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
function shortcode_render($attr) {
|
14 |
|
15 |
global $cryout_serious_slider;
|
@@ -37,39 +64,31 @@ class Cryout_Serious_Slider_Shortcode {
|
|
37 |
$s2 = 'DESC';
|
38 |
endif;
|
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 |
-
-webkit-transition-duration: <?php echo round($transition/1000,2) ?>s;
|
67 |
-
-o-transition-duration: <?php echo round($transition/1000,2) ?>s;
|
68 |
-
transition-duration: <?php echo round($transition/1000,2) ?>s; }
|
69 |
-
</style>
|
70 |
-
<!-- cryout serious slider -->
|
71 |
-
<?php if ( $the_query->have_posts() ): ?>
|
72 |
-
<div id="Serious-Slider-<?php echo $cid ?>" class="cryout-serious-slider seriousslider <?php echo $slider_classes ?>" data-ride="seriousslider">
|
73 |
<div class="seriousslider-inner" role="listbox">
|
74 |
|
75 |
<?php while ($the_query->have_posts()):
|
@@ -94,9 +113,11 @@ class Cryout_Serious_Slider_Shortcode {
|
|
94 |
?>
|
95 |
|
96 |
<div class="item slide-<?php echo $counter ?> <?php if ($counter==1) echo 'active' ?>">
|
|
|
97 |
<a <?php echo $meta_link; ?> <?php echo $meta_target; ?>>
|
98 |
<img src="<?php echo $image_data[0] ?>" alt="<?php the_title(); ?>" <?php echo $sizes ?>>
|
99 |
</a>
|
|
|
100 |
<div class="seriousslider-caption">
|
101 |
<h3 class="seriousslider-caption-title">
|
102 |
<a <?php echo $meta_link?> <?php echo $meta_target ?>><?php the_title(); ?></a>
|
@@ -110,21 +131,21 @@ class Cryout_Serious_Slider_Shortcode {
|
|
110 |
|
111 |
<ol class="seriousslider-indicators">
|
112 |
<?php for ($i=0;$i<$counter;$i++) { ?>
|
113 |
-
<li data-target="#
|
114 |
<?php } ?>
|
115 |
</ol>
|
116 |
|
117 |
-
<a class="left seriousslider-control" href="#
|
118 |
<span class="sicon-prev" aria-hidden="true"></span>
|
119 |
<span class="sr-only"><?php _e('Previous','cryout-serious-slider') ?></span>
|
120 |
</a>
|
121 |
-
<a class="right seriousslider-control" href="#
|
122 |
<span class="sicon-next" aria-hidden="true"></span>
|
123 |
<span class="sr-only"><?php _e('Next','cryout-serious-slider') ?></span>
|
124 |
</a>
|
125 |
</div>
|
126 |
<script type='text/javascript'>
|
127 |
-
jQuery('#
|
128 |
interval: <?php echo $delay ?>,
|
129 |
pause: '<?php echo $hover ?>',
|
130 |
stransition: <?php echo $transition ?>
|
@@ -141,17 +162,16 @@ class Cryout_Serious_Slider_Shortcode {
|
|
141 |
|
142 |
global $cryout_serious_slider;
|
143 |
|
144 |
-
if (is_numeric($sid))
|
145 |
$data = get_option( "cryout_serious_slider_${sid}_meta" );
|
146 |
if ( empty($data) ) $data = $cryout_serious_slider->defaults;
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
endif;
|
155 |
} // shortcode_options()
|
156 |
|
157 |
} // class
|
4 |
class Cryout_Serious_Slider_Shortcode {
|
5 |
|
6 |
public $shortcode_tag = 'serious-slider';
|
7 |
+
private $id = 0;
|
8 |
+
private $cid = 0;
|
9 |
|
10 |
function __construct($args = array()){
|
11 |
//register shortcode
|
12 |
add_shortcode( $this->shortcode_tag, array( $this, 'shortcode_render' ) );
|
13 |
}
|
14 |
|
15 |
+
function shortcode_style() {
|
16 |
+
$sid = $this->id;
|
17 |
+
$cid = $this->cid;
|
18 |
+
$options = $this->shortcode_options($sid);
|
19 |
+
foreach ($options as $id => $opt) ${$id} = $opt;
|
20 |
+
|
21 |
+
ob_start();
|
22 |
+
?><style type="text/css">
|
23 |
+
<!-- cryout serious slider -->
|
24 |
+
#serious-slider-<?php echo $cid ?> { max-width: <?php echo $width; ?>px; max-height: <?php echo $height; ?>px; }
|
25 |
+
#serious-slider-<?php echo $cid ?> .seriousslider-caption-title { font-size: <?php echo round($textsize*2,2) ?>em; }
|
26 |
+
#serious-slider-<?php echo $cid ?> .seriousslider-caption-text { font-size: <?php echo round($textsize,2) ?>em; }
|
27 |
+
#serious-slider-<?php echo $cid ?> .seriousslider-caption-text a { font-size: <?php echo round($textsize*0.8,2) ?>em; }
|
28 |
+
|
29 |
+
#serious-slider-<?php echo $cid ?> .seriousslider-inner > .item {
|
30 |
+
-webkit-transition-duration: <?php echo round($transition/1000,2) ?>s;
|
31 |
+
-o-transition-duration: <?php echo round($transition/1000,2) ?>s;
|
32 |
+
transition-duration: <?php echo round($transition/1000,2) ?>s; }
|
33 |
+
</style><?php
|
34 |
+
$custom_style = ob_get_contents();
|
35 |
+
ob_end_clean();
|
36 |
+
|
37 |
+
echo $custom_style;
|
38 |
+
} // shortcode_slyle()
|
39 |
+
|
40 |
function shortcode_render($attr) {
|
41 |
|
42 |
global $cryout_serious_slider;
|
64 |
$s2 = 'DESC';
|
65 |
endif;
|
66 |
|
67 |
+
$cid = abs($attr['id']).'_'.rand(1000,9999);
|
68 |
|
69 |
+
$the_query = new WP_Query(
|
70 |
+
array(
|
71 |
+
'post_type' => array( $cryout_serious_slider->posttype ),
|
72 |
+
'order' => $s2,
|
73 |
+
'orderby' => $s1,
|
74 |
+
'showposts' => $count,
|
75 |
+
'tax_query' => array(
|
76 |
+
array(
|
77 |
+
'taxonomy' => $cryout_serious_slider->taxonomy,
|
78 |
+
'field' => 'id',
|
79 |
+
'terms' => array( $cid ),
|
|
|
80 |
),
|
81 |
+
),
|
82 |
+
)
|
83 |
+
);
|
84 |
+
|
85 |
+
$counter = 0;
|
86 |
+
$this->id = $attr['id'];
|
87 |
+
$this->cid = $cid;
|
88 |
+
add_action( 'wp_footer', array($this, 'shortcode_style') );
|
89 |
+
|
90 |
+
if ( $the_query->have_posts() ): ?>
|
91 |
+
<div id="serious-slider-<?php echo $cid ?>" class="cryout-serious-slider seriousslider cryout-serious-slider-<?php echo $attr['id'] ?> <?php echo $slider_classes ?>" data-ride="seriousslider">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
<div class="seriousslider-inner" role="listbox">
|
93 |
|
94 |
<?php while ($the_query->have_posts()):
|
113 |
?>
|
114 |
|
115 |
<div class="item slide-<?php echo $counter ?> <?php if ($counter==1) echo 'active' ?>">
|
116 |
+
<?php if (!empty($image_data[0])): ?>
|
117 |
<a <?php echo $meta_link; ?> <?php echo $meta_target; ?>>
|
118 |
<img src="<?php echo $image_data[0] ?>" alt="<?php the_title(); ?>" <?php echo $sizes ?>>
|
119 |
</a>
|
120 |
+
<?php endif; ?>
|
121 |
<div class="seriousslider-caption">
|
122 |
<h3 class="seriousslider-caption-title">
|
123 |
<a <?php echo $meta_link?> <?php echo $meta_target ?>><?php the_title(); ?></a>
|
131 |
|
132 |
<ol class="seriousslider-indicators">
|
133 |
<?php for ($i=0;$i<$counter;$i++) { ?>
|
134 |
+
<li data-target="#serious-slider-<?php echo $cid ?>" data-slide-to="<?php echo $i?>" <?php if ($i==0) echo 'class="active"' ?>></li>
|
135 |
<?php } ?>
|
136 |
</ol>
|
137 |
|
138 |
+
<a class="left seriousslider-control" href="#serious-slider-<?php echo $cid ?>" role="button" data-slide="prev">
|
139 |
<span class="sicon-prev" aria-hidden="true"></span>
|
140 |
<span class="sr-only"><?php _e('Previous','cryout-serious-slider') ?></span>
|
141 |
</a>
|
142 |
+
<a class="right seriousslider-control" href="#serious-slider-<?php echo $cid; ?>" role="button" data-slide="next">
|
143 |
<span class="sicon-next" aria-hidden="true"></span>
|
144 |
<span class="sr-only"><?php _e('Next','cryout-serious-slider') ?></span>
|
145 |
</a>
|
146 |
</div>
|
147 |
<script type='text/javascript'>
|
148 |
+
jQuery('#serious-slider-<?php echo $cid ?>').carousel({
|
149 |
interval: <?php echo $delay ?>,
|
150 |
pause: '<?php echo $hover ?>',
|
151 |
stransition: <?php echo $transition ?>
|
162 |
|
163 |
global $cryout_serious_slider;
|
164 |
|
165 |
+
if (is_numeric($sid)) {
|
166 |
$data = get_option( "cryout_serious_slider_${sid}_meta" );
|
167 |
if ( empty($data) ) $data = $cryout_serious_slider->defaults;
|
168 |
+
} else {
|
169 |
+
$data = $cryout_serious_slider->defaults;
|
170 |
+
}
|
171 |
+
foreach ($data as $id=>$value){
|
172 |
+
$options[str_replace('cryout_serious_slider_','',$id)] = $value;
|
173 |
+
}
|
174 |
+
return $options;
|
|
|
175 |
} // shortcode_options()
|
176 |
|
177 |
} // class
|
inc/slider.php
CHANGED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<style type="text/css">
|
2 |
+
#Serious-Slider-<?php echo $cid ?> { max-width: <?php echo $width; ?>px; <?php if ($sizing) { ?>max-height: <?php echo $height; ?>px;<?php } ?> }
|
3 |
+
#Serious-Slider-<?php echo $cid ?> .seriousslider-caption-title { font-size: <?php echo round($textsize*2,2) ?>em; }
|
4 |
+
#Serious-Slider-<?php echo $cid ?> .seriousslider-caption-text { font-size: <?php echo round($textsize,2) ?>em; }
|
5 |
+
#Serious-Slider-<?php echo $cid ?> .seriousslider-caption-text a { font-size: <?php echo round($textsize*0.8,2) ?>em; }
|
6 |
+
<?php if ($sizing) { ?> #Serious-Slider-<?php echo $cid ?> .seriousslider-inner img.item-image { height: <?php echo $height; ?>px; } <?php } ?>
|
7 |
+
|
8 |
+
#Serious-Slider-<?php echo $cid ?> .seriousslider-inner > .item {
|
9 |
+
-webkit-transition-duration: <?php echo round($transition/1000,2) ?>s;
|
10 |
+
-o-transition-duration: <?php echo round($transition/1000,2) ?>s;
|
11 |
+
transition-duration: <?php echo round($transition/1000,2) ?>s; }
|
12 |
+
</style>
|
13 |
+
<!-- cryout serious slider -->
|
14 |
+
<?php if ( $the_query->have_posts() ): ?>
|
15 |
+
<div id="Serious-Slider-<?php echo $cid ?>" class="cryout-serious-slider seriousslider <?php echo $slider_classes ?>" data-ride="seriousslider">
|
16 |
+
<div class="seriousslider-inner" role="listbox">
|
17 |
+
|
18 |
+
<?php while ($the_query->have_posts()):
|
19 |
+
$the_query->the_post();
|
20 |
+
$counter++;
|
21 |
+
|
22 |
+
// default parameters
|
23 |
+
$meta_link = '';
|
24 |
+
$meta_target = '';
|
25 |
+
$sizes = '';
|
26 |
+
|
27 |
+
// retrieve parameters
|
28 |
+
$slide_link = get_post_meta( get_the_ID(), 'cryout_serious_slider_link' );
|
29 |
+
$slide_target = get_post_meta( get_the_ID(), 'cryout_serious_slider_target' );
|
30 |
+
if ( !empty($slide_link) ) $meta_link = ' href="' . $slide_link[0] . '"';
|
31 |
+
if ( !empty($slide_target) ) $meta_target = 'target="_blank"';
|
32 |
+
|
33 |
+
$image_data = wp_get_attachment_image_src (get_post_thumbnail_ID( get_the_ID() ), 'full' );
|
34 |
+
|
35 |
+
if ( !empty($sizing) && $sizing ) $sizes = 'width="' . $width . '" height="' . $height . '"';
|
36 |
+
|
37 |
+
?>
|
38 |
+
|
39 |
+
<div class="item slide-<?php echo $counter ?> <?php if ($counter==1) echo 'active' ?>">
|
40 |
+
<a <?php echo $meta_link; ?> <?php echo $meta_target; ?>>
|
41 |
+
<img src="<?php echo $image_data[0] ?>" alt="<?php the_title(); ?>" <?php echo $sizes ?> class="item-image">
|
42 |
+
</a>
|
43 |
+
<div class="seriousslider-caption">
|
44 |
+
<h3 class="seriousslider-caption-title">
|
45 |
+
<a <?php echo $meta_link?> <?php echo $meta_target ?>><?php the_title(); ?></a>
|
46 |
+
</h3>
|
47 |
+
<div class="seriousslider-caption-text"><?php the_content() ?></div>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
|
51 |
+
<?php endwhile; ?>
|
52 |
+
</div>
|
53 |
+
|
54 |
+
<ol class="seriousslider-indicators">
|
55 |
+
<?php for ($i=0;$i<$counter;$i++) { ?>
|
56 |
+
<li data-target="#Serious-Slider-<?php echo $cid ?>" data-slide-to="<?php echo $i?>" <?php if ($i==0) echo 'class="active"' ?>></li>
|
57 |
+
<?php } ?>
|
58 |
+
</ol>
|
59 |
+
|
60 |
+
<a class="left seriousslider-control" href="#Serious-Slider-<?php echo $cid ?>" role="button" data-slide="prev">
|
61 |
+
<span class="sicon-prev" aria-hidden="true"></span>
|
62 |
+
<span class="sr-only"><?php _e('Previous','cryout-serious-slider') ?></span>
|
63 |
+
</a>
|
64 |
+
<a class="right seriousslider-control" href="#Serious-Slider-<?php echo $cid; ?>" role="button" data-slide="next">
|
65 |
+
<span class="sicon-next" aria-hidden="true"></span>
|
66 |
+
<span class="sr-only"><?php _e('Next','cryout-serious-slider') ?></span>
|
67 |
+
</a>
|
68 |
+
</div>
|
69 |
+
<script type='text/javascript'>
|
70 |
+
jQuery('#Serious-Slider-<?php echo $cid ?>').carousel({
|
71 |
+
interval: <?php echo $delay ?>,
|
72 |
+
pause: '<?php echo $hover ?>',
|
73 |
+
stransition: <?php echo $transition ?>
|
74 |
+
})
|
75 |
+
</script>
|
76 |
+
<?php endif; ?>
|
77 |
+
<!-- end cryout serious slider -->
|
inc/widgets.php
CHANGED
@@ -42,7 +42,9 @@ class Cryout_Serious_Slider_Widget extends WP_Widget {
|
|
42 |
function widget($args, $instance) {
|
43 |
if(!empty($instance['sid'])) {
|
44 |
$slider_id = $instance['sid'];
|
|
|
45 |
do_shortcode( '[' . $this->shortcode_tag . ' id=' . $slider_id. ']' );
|
|
|
46 |
};
|
47 |
} // widget()
|
48 |
|
42 |
function widget($args, $instance) {
|
43 |
if(!empty($instance['sid'])) {
|
44 |
$slider_id = $instance['sid'];
|
45 |
+
echo $args['before_widget'];
|
46 |
do_shortcode( '[' . $this->shortcode_tag . ' id=' . $slider_id. ']' );
|
47 |
+
echo $args['after_widget'];
|
48 |
};
|
49 |
} // widget()
|
50 |
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Plugin Name ===
|
2 |
-
Contributors: cryout-creations
|
3 |
Donate link: http://www.cryoutcreations.eu/donate/
|
4 |
Tags: slider, carousel, shortcode, bootstrap, responsive, responsive slider
|
5 |
Requires at least: 4.0
|
6 |
-
Tested up to: 4.5.
|
7 |
-
Stable tag: 0.5
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl.html
|
10 |
|
@@ -44,5 +44,18 @@ Responsive slider, built on Bootstrap Carousel, uses core WordPress functionalit
|
|
44 |
|
45 |
== Changelog ==
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
= 0.5 =
|
48 |
* Initial release.
|
1 |
=== Plugin Name ===
|
2 |
+
Contributors: cryout-creations, Cryout Creations
|
3 |
Donate link: http://www.cryoutcreations.eu/donate/
|
4 |
Tags: slider, carousel, shortcode, bootstrap, responsive, responsive slider
|
5 |
Requires at least: 4.0
|
6 |
+
Tested up to: 4.5.3
|
7 |
+
Stable tag: 0.5.1
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl.html
|
10 |
|
44 |
|
45 |
== Changelog ==
|
46 |
|
47 |
+
= 0.5.1 =
|
48 |
+
* Moved inline styling to footer
|
49 |
+
* Fixed responsive styling issue on about page
|
50 |
+
* Added widget HTML wrapper for better compatibility with themes
|
51 |
+
* Added get_sliders_list() function for custom theme integration
|
52 |
+
* Improved 'No slides' message to link to slider management / sample slider loader.
|
53 |
+
* Corrected slider selection label in slider metabox
|
54 |
+
* Corrected insert slider window to display 'no slider available' message when there are no sliders
|
55 |
+
* Fixed missing closing bracked in template code example
|
56 |
+
* Fixed slider image tag to only be outputted when an image was defined
|
57 |
+
* Improved contrained slider layout
|
58 |
+
* Fixed missing insert slider icon in TinyMCE editor
|
59 |
+
|
60 |
= 0.5 =
|
61 |
* Initial release.
|
resources/backend.css
CHANGED
@@ -108,10 +108,9 @@ select#filter-by-date {
|
|
108 |
left: 100%;
|
109 |
}
|
110 |
#floater-right textarea, #floater-right input[type="text"] {
|
111 |
-
width:
|
112 |
border: 0;
|
113 |
padding: 10px;
|
114 |
-
//background: transparent;
|
115 |
box-shadow: none;
|
116 |
font-weight: bold;
|
117 |
}
|
108 |
left: 100%;
|
109 |
}
|
110 |
#floater-right textarea, #floater-right input[type="text"] {
|
111 |
+
width: 100%;
|
112 |
border: 0;
|
113 |
padding: 10px;
|
|
|
114 |
box-shadow: none;
|
115 |
font-weight: bold;
|
116 |
}
|
resources/style.css
CHANGED
@@ -67,8 +67,7 @@
|
|
67 |
content: "\e055";
|
68 |
}
|
69 |
|
70 |
-
.seriousslider-inner > .item
|
71 |
-
.seriousslider-inner > .item > a > img {
|
72 |
display: block;
|
73 |
max-width: 100%;
|
74 |
height: auto;
|
@@ -82,6 +81,7 @@
|
|
82 |
.seriousslider-inner {
|
83 |
position: relative;
|
84 |
width: 100%;
|
|
|
85 |
overflow: hidden;
|
86 |
}
|
87 |
.seriousslider-inner > .item {
|
@@ -398,6 +398,10 @@
|
|
398 |
***************/
|
399 |
|
400 |
/* General */
|
|
|
|
|
|
|
|
|
401 |
.seriousslider-control {
|
402 |
position: absolute;
|
403 |
top: 0;
|
@@ -422,7 +426,7 @@
|
|
422 |
top: 50%;
|
423 |
z-index: 5;
|
424 |
display: inline-block;
|
425 |
-
margin-top: -
|
426 |
}
|
427 |
.seriousslider-control .sicon-prev {
|
428 |
left: 50%;
|
@@ -480,16 +484,6 @@ ol.seriousslider-indicators .active {}
|
|
480 |
text-shadow: none;
|
481 |
}
|
482 |
@media screen and (min-width: 768px) {
|
483 |
-
.seriousslider-control .sicon-prev,
|
484 |
-
.seriousslider-control .sicon-next {
|
485 |
-
margin-top: -10px;
|
486 |
-
}
|
487 |
-
.seriousslider-control .sicon-prev {
|
488 |
-
margin-left: -10px;
|
489 |
-
}
|
490 |
-
.seriousslider-control .sicon-next {
|
491 |
-
margin-right: -10px;
|
492 |
-
}
|
493 |
.seriousslider-caption {
|
494 |
right: 20%;
|
495 |
left: 20%;
|
67 |
content: "\e055";
|
68 |
}
|
69 |
|
70 |
+
.seriousslider-inner > .item img.item-image {
|
|
|
71 |
display: block;
|
72 |
max-width: 100%;
|
73 |
height: auto;
|
81 |
.seriousslider-inner {
|
82 |
position: relative;
|
83 |
width: 100%;
|
84 |
+
height: 100%;
|
85 |
overflow: hidden;
|
86 |
}
|
87 |
.seriousslider-inner > .item {
|
398 |
***************/
|
399 |
|
400 |
/* General */
|
401 |
+
|
402 |
+
.seriousslider .seriousslider-caption-title {
|
403 |
+
margin: 0;
|
404 |
+
}
|
405 |
.seriousslider-control {
|
406 |
position: absolute;
|
407 |
top: 0;
|
426 |
top: 50%;
|
427 |
z-index: 5;
|
428 |
display: inline-block;
|
429 |
+
margin-top: -0.5em;
|
430 |
}
|
431 |
.seriousslider-control .sicon-prev {
|
432 |
left: 50%;
|
484 |
text-shadow: none;
|
485 |
}
|
486 |
@media screen and (min-width: 768px) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
487 |
.seriousslider-caption {
|
488 |
right: 20%;
|
489 |
left: 20%;
|