Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #725055

    if i have sometimes changings in avia.js
    i do it via child-theme and a copy of avia.js and in functions.php:

    function wp_change_aviajs() {
       wp_dequeue_script( 'avia-default' );
       wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/avia.js', array('jquery'), 2, true );
    }
    add_action( 'wp_print_scripts', 'wp_change_aviajs', 100 );

    on one installation with enfold 3.84 i got now the loading of both child-theme and parent-theme
    the parent theme avia.js wasn’t dequeued

    #725617

    Hey Guenter,

    We are going to need FTP and WP admin logins to look into it as it does work fine on my local installation :)

    Best regards,
    Yigit

    #725668

    Ok – there is on child-theme functions.php allready a test for autoclose lightbox after youtube video stops – but it does not work now
    it is much more complicated from the inner of the iframe to close the iframe after playing. But to prove the avia.js case you can erase it here.

    Maybe yu got an idea – pleas look to the other thread
    https://kriesi.at/support/topic/autoclose-video-lightbox/

    • This reply was modified 8 years ago by Guenni007.
    #726643

    Hi,

    I changed the code to following one

    add_action( 'wp_enqueue_scripts', 'wp_change_aviajs', 100 );
    function wp_change_aviajs() {
       wp_deregister_script( 'avia-default' );
       wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/avia.js', array('jquery'), 2, true );
    }

    Please review your website now

    Best regards,
    Yigit

    #726996

    hm – just the rearrangement did the trick ? OK
    Is it important to have allways the add_action first and than the function.

    Because a lot of php tips here on board handle it this and that way?

    #727013

    Hey!

    I changed the hook from “wp_print_scripts” to “wp_enqueue_scripts” and “wp_dequeue_script” to “wp_deregister_script” :)

    Best regards,
    Yigit

    #727248

    oh sorry now i see – thanks – can be closed

    #727249

    Hey!

    Not at all Guenni007. Enjoy your holidays :)

    Best regards,
    Yigit

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘double loading of avia.js’ is closed to new replies.