Help with the Sliders API – need image slider similar to Post Grid Slider
-
Topic
-
I need a slider that displays like the Post Grid Slider, but for images, not posts. This seems doable using the include Flexslider and TB’s Sliders API (awesome api – thank you for including!).
Flexslider’s “Basic Carousel” slider capability is described here: http://flexslider.woothemes.com/basic-carousel.html
Here’s what I have so far. Please help me with settings for $media_positions and $slide_elements or any suggested html needed to get a similar effect as the Post Grid Slider. I also need to enable specifying a link URL for each image in the slider admin. TIA for any help!
// Slide types $slide_types = array('image'); // Media positions - Full Width only, and because we're not using images, we'll leave crop size blank. $media_positions = array('full' => 'medium'); // Slide elements - none $slide_elements = array(); // Options $options = array( array( 'id' => 'fx', 'name' => 'How to transition between slides?', 'std' => 'slide', 'type' => 'select', 'options' => array( 'fade' => 'Fade', 'slide' => 'Slide' ) ), ); // Add Slider type themeblvd_add_slider( 'thumbnails_slider', 'Thumbnails Slider', $slide_types, $media_positions, $slide_elements, $options, 'display_thumbnails_slider' ); // Display slider function display_thumbnails_slider( $slider, $settings, $slides ) { // For development // Enqueue Flexslider script wp_enqueue_script( 'flexslider' ); // will be added to wp_footer() ?> <script> jQuery(document).ready(function($){ $(window).load(function() { $("#<?php echo $slider; ?>").flexslider({ animationLoop: false, itemWidth: 350, itemMargin: 5, controlNav: false, slideshow: false, animation: "<?php echo $settings['fx']; ?>" }); }); }); </script> <div id="<?php echo $slider; ?>" class="flexslider"> <ul class="slides"> <?php foreach( $slides as $slide ) : ?> <li><img src="<?php echo $slide['image']['display']; ?>"></li> <?php endforeach; ?> </ul> </div> <?php }
- The forum ‘Alyeska Responsive WordPress Theme’ is closed to new topics and replies.