- This topic has 3 replies, 1 voice, and was last updated 7 years, 5 months ago by MatiasP.
- AuthorPosts
- July 5, 2017 at 1:49 am #3162MatiasPParticipant
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?
July 5, 2017 at 2:03 am #3163MatiasPParticipantThis error is outputted in the console every time this happens:
July 5, 2017 at 2:31 am #3164MatiasPParticipantOk, 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?
July 7, 2017 at 1:05 am #3166MatiasPParticipantI 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 ); }
- AuthorPosts
- You must be logged in to reply to this topic.