Home Forums Total Slider sometimes shows all pictures at once

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3162
    MatiasP
    Participant

    My browser sometimes shows all pictures in the picture slider in the home page. One on top of the other. It happens on Chrome, Firefox, Firefox Mobile, and IE. It only happens the first time. When you refresh the page, it gets fixed. What could it be?

    #3163
    MatiasP
    Participant

    This error is outputted in the console every time this happens:

    Error

    #3164
    MatiasP
    Participant

    Ok, it looks like the error was of my own doing. I overrode the original total-custom.js file on my child theme to customize some things. As soon as I commented out that code on my functions.php file, that error does not appear anymore. But now I’m wondering what I did wrong. This is how I’m enqueing my own total-custom.js file in my functions.php file:

    wp_dequeue_script('total-custom');
    wp_dequeue_script('owl-carousel');
    wp_enqueue_script( 'total-custom', get_template_directory_uri() . '/js/total-custom.js', array('jquery'), '20150903', true );

    What’s in my total-custom.js file can’t be the problem because I only changed some transition time values. That’s it. What could it be?

    #3166
    MatiasP
    Participant

    I solved it. I was dequeuing and enqueuing the scripts incorrectly. Here’s the final code:

    add_action( 'wp_enqueue_scripts', 'total_custom_dequeing_scripts', 99999);
    function total_custom_dequeing_scripts()
    {
        wp_dequeue_script('total-custom');
        wp_deregister_script('total-custom');
    
        wp_dequeue_script('owl-carousel');
        wp_deregister_script('owl-carousel');
    
        wp_enqueue_script( 'child-total-custom', get_stylesheet_directory_uri() . '/js/total-custom.js', array('jquery'), '20150903', true );
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.