You have javascript
error in file, named shapely-scripts.js
. javascript
stopes executing code located after error in one file/<script></script> tags
.
In your case, the ways to save all theme js functions and fixing errors, are:
1. First way:
Modify .js
file of theme. Even after modification, if you'll update your theme, you'll lose all changes you made. Here is what you need to change:
Go to {your-website-folder}/wp-content/themes/shapely/assets/js/
using file manager/ftp connection
and find shapely-scripts.js
file. After find this code in that file
// Smooth scroll
if ( '' !== window.location.hash ) {
element = $( '#site-navigation #menu a[href=' + window.location.hash + ']' );
if ( element ) {
scrollToID = '#' + element.data( 'scroll' );
$( 'html,body' ).animate( {
scrollTop: $( scrollToID ).offset().top
}, 2000 );
newURL = window.location.href.replace( window.location.hash, '' );
window.history.replaceState( {}, document.title, newURL );
}
}
It's starts on line 24 and endes on line 36, and replace with this one:
if ('' !== window.location.hash) {
element = $('#site-navigation #menu a[href=' + window.location.hash + ']');
if (element.length > 0) {
scrollToID = '#' + element.data('scroll');
$('html,body').animate({
scrollTop: $(scrollToID).offset().top
}, 2000);
}else {
element = $(window.location.hash);
if (element.length > 0) {
$('html,body').animate({
scrollTop: $(element).offset().top
}, 2000);
}
}
newURL = window.location.href.replace(window.location.hash, '');
window.history.replaceState({}, document.title, newURL);
}
After this changes your theme js file will work without any errors, which mean that hamburger menu will work, too.
2. Second way ( if you're using child theme ):
Copy file named shapely-scripts.js
( mentioned in option 1 ) in some folder of your child theme. Make changes described in option 1 with copied file shapely-scripts.js
( in your child theme ). After this you'll need to prevent file in your parent theme from loading, and instead of it load file from child theme. This will always load your changed file, even when you update your parent theme