Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #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));

    #398598

    Hi,

    Can you post the link to your website please? have you checked the JavaScript console?

    Regards,
    Josue

    #399330
    This reply has been marked as private.
    #399336

    Hey!

    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!
    Josue

    #399337
    This reply has been marked as private.
    #399344

    Hm, try with only the code i passed you here, i’ve tested that on my local install and it worked fine.

    Regards,
    Josue

    #399346
    This reply has been marked as private.
    #399353

    Well, that won’t work that way. You need to put the whole modified shortcodes.js there (in the child js folder).

    #399357

    Woa, AWESOME!

    It works! :-) Thank you so much, Josue!

    Warm greetings,
    C

    #399367

    Glad 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,
    Josue

    #399700

    Hi Josue!

    Okay, thank you for your input, I will do so. :-)

    Kind regards!
    C

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Edit shortcodes.js in child theme’ is closed to new replies.