Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #460639

    I added a custom JS on child theme in this thread:
    https://kriesi.at/support/topic/mobile-menu-34/#post-457462

    The custom menu is working. However, I recently found that all the dropdown in the backend is not working with the following JS error from my custom js on the child theme.

    “avia.js?ver=2:606 Uncaught TypeError: $.avia_utilities.supports is not a function” and I also got a lot of error of “wp-admin/load-scripts.php?c=1&lo…,underscore,backbone,utils,jquery-ui-core,jquery-ui-datepicker&ver=4.2.2:4 Uncaught TypeError: undefined is not a function” when I try to hide the dropdown (screen option dropdown from the top) from the wordpress admin.

    #460801

    Hey boscotwcheung!

    What version of Enfold are you using? Can you send us a link to the page?

    Make sure to deactivate all plugins while testing and try adding this to your wp-config.php file.

    define( 'CONCATENATE_SCRIPTS', false );
    

    Best regards,
    Elliott

    #461040
    This reply has been marked as private.
    #461073

    Hi!

    Change code to:

    // overwrite the avia.js
    function wp_change_aviajs() {
    if(!is_admin()){
       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 );

    Regards,
    Josue

    #461078

    Thanks! it works.

    #461087

    You are welcome, glad to help :)

    Regards,
    Josue

    #480513

    Thanks

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Custom JS on child theme’ is closed to new replies.