-
AuthorPosts
-
February 19, 2015 at 12:55 am #398566
Hello!
I wanted to put this modification ( #338188 ) into the shortcodes.js of my child theme. (Until now I edited the parent theme after each update). I activated the child theme but the code is not working. What did I miss? This is what I put into shortcodes.js of the child theme:
/* ======================================================================================================================================================
Avia Slideshow
====================================================================================================================================================== */(function($)
{
“use strict”;$.AviaSlider.defaults = {
//transition speed when switching slide
transitionSpeed:900,};
}(jQuery));
February 19, 2015 at 3:10 am #398598Hi,
Can you post the link to your website please? have you checked the JavaScript console?
Regards,
JosueFebruary 20, 2015 at 12:01 am #399330This reply has been marked as private.February 20, 2015 at 12:10 am #399336Hey!
Ok, copy the modified shortcodes.js to your_child_theme_folder/js/shortcodes.js and add this at the very end of your child theme functions.php file:
function change_aviajs() { wp_dequeue_script( 'avia-shortcodes' ); wp_enqueue_script( 'avia-shortcodes-child', get_stylesheet_directory_uri().'/js/shortcodes.js', array('jquery'), 3, true ); } add_action( 'wp_enqueue_scripts', 'change_aviajs', 100 );
Cheers!
JosueFebruary 20, 2015 at 12:11 am #399337This reply has been marked as private.February 20, 2015 at 12:23 am #399344Hm, try with only the code i passed you here, i’ve tested that on my local install and it worked fine.
Regards,
JosueFebruary 20, 2015 at 12:27 am #399346This reply has been marked as private.February 20, 2015 at 12:35 am #399353Well, that won’t work that way. You need to put the whole modified shortcodes.js there (in the child js folder).
February 20, 2015 at 12:44 am #399357Woa, AWESOME!
It works! :-) Thank you so much, Josue!
Warm greetings,
CFebruary 20, 2015 at 1:04 am #399367Glad it worked, be aware though, that this file is updated when new features and elements are added to the theme so it is recommended to re-do this process, check for the version.txt included in each update, most of the times you’ll only need to do it on big patches like the upcoming 3.1.
Best regards,
JosueFebruary 20, 2015 at 3:35 pm #399700Hi Josue!
Okay, thank you for your input, I will do so. :-)
Kind regards!
C -
AuthorPosts
- The topic ‘Edit shortcodes.js in child theme’ is closed to new replies.