adding theme customizer options for slider
This commit is contained in:
parent
d551dbe389
commit
002665d98f
|
@ -32,6 +32,8 @@
|
||||||
|
|
||||||
<!-- Loads slider script and settings if a widget on pos hero is published -->
|
<!-- Loads slider script and settings if a widget on pos hero is published -->
|
||||||
<?php if ( is_active_sidebar( 'hero' ) ): ?>
|
<?php if ( is_active_sidebar( 'hero' ) ): ?>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
var owl = jQuery('.owl-carousel');
|
var owl = jQuery('.owl-carousel');
|
||||||
|
@ -39,7 +41,7 @@
|
||||||
items:1,
|
items:1,
|
||||||
loop:true,
|
loop:true,
|
||||||
autoplay:true,
|
autoplay:true,
|
||||||
autoplayTimeout:5000,
|
autoplayTimeout:<?php echo get_theme_mod( 'understrap_theme_slider_time_setting' );?>,
|
||||||
animateOut: 'fadeOut',
|
animateOut: 'fadeOut',
|
||||||
animateIn: 'fadeIn',
|
animateIn: 'fadeIn',
|
||||||
nav: false,
|
nav: false,
|
||||||
|
|
|
@ -18,6 +18,25 @@ function understrap_customize_register( $wp_customize ) {
|
||||||
}
|
}
|
||||||
add_action( 'customize_register', 'understrap_customize_register' );
|
add_action( 'customize_register', 'understrap_customize_register' );
|
||||||
|
|
||||||
|
function understrap_theme_customize_register( $wp_customize ) {
|
||||||
|
|
||||||
|
$wp_customize->add_section( 'understrap_theme_slider_options', array(
|
||||||
|
'title' => __( 'Slider Settings', 'understrap' )
|
||||||
|
) );
|
||||||
|
|
||||||
|
$wp_customize->add_setting( 'understrap_theme_slider_time_setting', array(
|
||||||
|
'default' => '5000'
|
||||||
|
) );
|
||||||
|
|
||||||
|
$wp_customize->add_control( 'understrap_theme_slider_time', array(
|
||||||
|
'label' => __( 'Slider Time', 'understrap' ),
|
||||||
|
'section' => 'understrap_theme_slider_options',
|
||||||
|
'type' => 'text',
|
||||||
|
'settings' => 'understrap_theme_slider_time_setting'
|
||||||
|
) );
|
||||||
|
}
|
||||||
|
add_action( 'customize_register', 'understrap_theme_customize_register' );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
|
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
|
||||||
*/
|
*/
|
||||||
|
|
Reference in New Issue