Override flexslider settings in child theme

Viewing 1 post (of 1 total)
  • #21683
    wahhabb
    Participant

    Hi! Love this theme!
    I need to modify some of the flexslider settings. I have created a child theme so that I don’t lose my changes when you have theme updates. I’ve tried to do that in my functions.php file with the following code, but it isn’t working. The functions in flexslider_script_fix are run, the old script is not removed and my new script is not run. Can you offer any help? Maybe it can be done without replacing the script? Thanks!

    add_action( ‘wp_enqueue_scripts’, ‘flexslider_script_fix’, 100 );

    function flexslider_script_fix()
    {
    wp_dequeue_script( ‘enlightenment_enqueue_flexslider_script’ );
    add_action(‘wp_enqueue_scripts’, ‘ssv_enqueue_flexslider_script’);
    }
    function ssv_enqueue_flexslider_script() {
    if( is_active_widget( false, false, ‘enlightenment-custom-query’ ) ) {
    wp_enqueue_script( ‘flexslider’ );
    $args = array(
    ‘selector’ => ‘.custom-query-slider’,
    ‘controlNav’ => false,
    ‘fadeFirstSlide’ => false,
    ‘slideshowSpeed’ => 20000, // change: increase to 20 seconds!
    ‘randomize’ => true, // change
    ‘controlNav’ => true, // change
    );
    wp_localize_script( ‘flexslider’, ‘enlightenment_slider_args’, $args );
    $args = array(
    ‘selector’ => ‘.custom-query-carousel’,
    ‘controlNav’ => true, // Change
    ‘animation’ => ‘slide’,
    ‘animationLoop’ => false,
    ‘slideshow’ => false,
    ‘itemWidth’ => 155,
    ‘itemMargin’ => 30,
    ‘minItems’ => 6,
    ‘maxItems’ => 6,
    ‘move’ => 1,
    );
    wp_localize_script( ‘flexslider’, ‘enlightenment_carousel_args’, $args );
    }
    }

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.