Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'after_setup_theme', 'child_theme_setup', 20 );
- function child_theme_setup() {
- remove_shortcode( 'fullscreen_slider' );
- add_shortcode( 'fullscreen_slider', 'my_fullscreen_slider' );
- }
- function my_fullscreen_slider($attributes, $content = null)
- {
- $attributes = shortcode_atts(
- array(
- 'interval' => 5000,
- 'transition' => 2,
- 'speed' => 400,
- ), $attributes);
- global $first_slide;
- $first_slide = TRUE;
- $interval = (is_numeric($attributes['interval']))?round($attributes['interval']):5000;
- $speed = (is_numeric($attributes['speed']))?round($attributes['speed']):400;
- $transition = (in_array($attributes['transition'], array(0, 1, 2, 3, 4, 5, 6, 7)))?$attributes['transition']:2;
- $output = '<div class="us_supersized">
- <a id="prevslide" class="load-item"><i class="fa fa-chevron-left"></i></a>
- <a id="nextslide" class="load-item"><i class="fa fa-chevron-right"></i></a>
- <div class="slidecaption">
- <div id="slidecaption"></div>
- </div>
- <ul id="slide-list"></ul>
- </div>
- <script type="text/javascript">
- jQuery(document).ready(function() {
- jQuery.supersized({
- // Functionality
- slide_interval : '.$interval.', // Length between transitions
- transition : '.$transition.', // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
- transition_speed : '.$speed.', // Speed of transition
- slide_links : "blank",
- // Components
- slides : [ // Slideshow Images
- '.do_shortcode($content).'
- ]
- });
- });
- </script>
- <style>
- ul#slide-list {
- padding: 15px 0;
- float: left;
- position: absolute;
- left: 50%;
- bottom: 0;
- }
- ul#slide-list li {
- list-style: none;
- width: 12px;
- height: 12px;
- float: left;
- margin: 0 5px 0 0;
- }
- ul#slide-list li.current-slide a, ul#slide-list li.current-slide a:hover {
- background-color: grey;
- }
- ul#slide-list li a {
- display: block;
- width: 12px;
- height: 12px;
- background-color: white;
- border-radius: 50%;
- }
- ul#slide-list li a:hover {
- background-color: grey;
- cursor: pointer;
- }
- </style>';
- return $output;
- }
Advertisement
Add Comment
Please, Sign In to add comment