-
AuthorPosts
-
January 27, 2025 at 7:11 pm #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,
JedJanuary 27, 2025 at 9:11 pm #1475882what 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.jsto 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 );
January 28, 2025 at 6:24 am #1475896January 28, 2025 at 10:14 am #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.January 29, 2025 at 5:58 am #1475954Hi,
@Guenni007: Could you provide a direct link to the folder? I can’t find it in the KriesiMedia/enfold-library.Best regards,
IsmaelJanuary 29, 2025 at 6:59 pm #1475978https://github.com/KriesiMedia/enfold-library
on the bottom of that page there is a link under “Online Resources from Third Party Developers”
January 30, 2025 at 6:42 am #1475995 -
AuthorPosts
- You must be logged in to reply to this topic.