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

    Hi,

    I need to add customization to the mobile hamburger menu/nav bar. The code I need to customize is in enfold/js/avia-snippet-hamburger-menu.js in function avia_hamburger_menu(). I tried making a copy of this file in my child theme, enfold-child, and making the modifications there, but that did not work. So, for now I just made the modifications in enfold/js/avia-snippet-hamburger-menu.js. This works but obviously is not ideal when theme updates happen. Is there a way to make this modification in a file that won’t be updated in the main enfold theme? I am using enfold 6.0.8.

    Thanks,
    Jed

    #1475882

    what you try to influence on the hamburger script file?

    you can deregister the parent script and register child-theme edited files then.
    My recommendation is to have the same tree structure as the parent – create a js subfolder in your child-theme directory.

    if you use the option of enfold to use minified files – you had to upload both files – in your case:
    avia-snippet-hamburger-menu.js and avia-snippet-hamburger-menu.min.js

    to get the minified version you can use this : https://codebeautify.org/minify-js

    put this in your child-theme functions.php :

    function wp_change_hamburger_script() {
      $vn = avia_get_theme_version();
      $child_theme_url = get_stylesheet_directory_uri();
      $min_js = avia_minify_extension( 'js' );
    
      wp_deregister_script( 'avia-hamburger-menu' );
      wp_enqueue_script('avia-hamburger-menu-child', "{$child_theme_url}/js/avia-snippet-hamburger-menu{$min_js}.js", array('avia-default'), $vn, true);
    }
    add_action( 'wp_enqueue_scripts', 'wp_change_hamburger_script', 100 );
    #1475896

    Hi,

    Thank you for the info @Guenni007.

    Best regards,
    Ismael

    #1475914

    @Ismael : can you erase from GitHub Library on “Online Resources from Third Party Developers” the
    “Disable loading of Google fonts and host them on your on server by Guenni007Disable loading of Google fonts and host them on your on server by Guenni007”
    it is a bit deprecated since Enfold Font Manager is established.

    #1475954

    Hi,


    @Guenni007
    : Could you provide a direct link to the folder? I can’t find it in the KriesiMedia/enfold-library.

    Best regards,
    Ismael

    #1475978

    https://github.com/KriesiMedia/enfold-library

    on the bottom of that page there is a link under “Online Resources from Third Party Developers”

    #1475995

    Hi,


    @Guenni007
    : We deleted the entry from the description.

    Best regards,
    Ismael

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.