-
AuthorPosts
-
December 15, 2016 at 10:51 pm #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 dequeuedDecember 17, 2016 at 3:10 am #725617Hey 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,
YigitDecember 17, 2016 at 10:54 am #725668Ok – 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, 10 months ago by
Guenni007.
December 20, 2016 at 4:40 pm #726643Hi,
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,
YigitDecember 21, 2016 at 1:16 pm #726996hm – 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?
December 21, 2016 at 2:12 pm #727013Hey!
I changed the hook from “wp_print_scripts” to “wp_enqueue_scripts” and “wp_dequeue_script” to “wp_deregister_script” :)
Best regards,
YigitDecember 21, 2016 at 7:32 pm #727248oh sorry now i see – thanks – can be closed
December 21, 2016 at 7:33 pm #727249 -
This reply was modified 8 years, 10 months ago by
-
AuthorPosts
- The topic ‘double loading of avia.js’ is closed to new replies.
