adding "number of slides at once" option

This commit is contained in:
Holger Koenemann 2015-02-16 15:19:44 +01:00
parent e9cd3e8f7e
commit f74ac9a879
2 changed files with 14 additions and 3 deletions

View File

@ -38,10 +38,10 @@
jQuery(document).ready(function() { jQuery(document).ready(function() {
var owl = jQuery('.owl-carousel'); var owl = jQuery('.owl-carousel');
owl.owlCarousel({ owl.owlCarousel({
items:1, items:<?php echo get_theme_mod( 'understrap_theme_slider_count_setting', 1 );?>,
loop:<?php echo get_theme_mod( 'understrap_theme_slider_loop_setting' );?>, loop:<?php echo get_theme_mod( 'understrap_theme_slider_loop_setting', true );?>,
autoplay:true, autoplay:true,
autoplayTimeout:<?php echo get_theme_mod( 'understrap_theme_slider_time_setting' );?>, autoplayTimeout:<?php echo get_theme_mod( 'understrap_theme_slider_time_setting', 5000 );?>,
animateOut: 'fadeOut', animateOut: 'fadeOut',
animateIn: 'fadeIn', animateIn: 'fadeIn',
nav: false, nav: false,

View File

@ -24,6 +24,17 @@ function understrap_theme_customize_register( $wp_customize ) {
'title' => __( 'Slider Settings', 'understrap' ) 'title' => __( 'Slider Settings', 'understrap' )
) ); ) );
$wp_customize->add_setting( 'understrap_theme_slider_count_setting', array(
'default' => '1'
) );
$wp_customize->add_control( 'understrap_theme_slider_count', array(
'label' => __( 'Number of slides displaying at once', 'understrap' ),
'section' => 'understrap_theme_slider_options',
'type' => 'text',
'settings' => 'understrap_theme_slider_count_setting'
) );
$wp_customize->add_setting( 'understrap_theme_slider_time_setting', array( $wp_customize->add_setting( 'understrap_theme_slider_time_setting', array(
'default' => '5000' 'default' => '5000'
) ); ) );