I am using Strategist FSE them but not to worry I used my coding knowledge and fixed it myself here is the solution for anyone using the same theme as you wont get support for this theme from the creators last updated was May 23rd 2023.
I dont need a theme that is maintained by other developers i maintain it myself as I’ve learned in the past relying on other developers is against one of my rules of development so hope this helps anyone with the issue i had. I just had to inspect the navigation to get all the info i needed to make the updates myself
Add this to functions.php in your Strategist FSE theme
// Navigation update for wordpress 6.6
function custom_mobile_menu_script() {
?>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
const menuToggle = document.querySelector('.wp-block-navigation__responsive-container-open');
const menu = document.querySelector('.wp-block-navigation__responsive-container');
const closeButton = document.querySelector('.wp-block-navigation__responsive-container-close');
if (menuToggle && menu) {
menuToggle.addEventListener('click', function() {
menu.classList.toggle('is-menu-open');
document.body.classList.toggle('menu-open');
});
}
if (closeButton) {
closeButton.addEventListener('click', function() {
menu.classList.remove('is-menu-open');
document.body.classList.remove('menu-open');
});
}
});
</script>
<?php
}
add_action('wp_footer', 'custom_mobile_menu_script');
You don’t need to use the css code bellow it will fall back to the styling used by the theme itself however you can use the css bellow if you want to style it yourself
/* Mobile navigation menu */
/* Ensure the menu is hidden by default */
.wp-block-navigation__responsive-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%; /* Cover the full viewport */
z-index: 9999; /* Ensure it is above other content */
overflow-y: auto; /* Allow scrolling if menu content exceeds viewport height */
transition: opacity 0.3s ease; /* Smooth transition for visibility */
}
/* Show the menu when it has the 'is-menu-open' class */
.wp-block-navigation__responsive-container.is-menu-open {
display: block; /* Show the menu */
opacity: 1; /* Ensure menu is fully opaque */
}
/* Disable scrolling on the body when menu is open */
body.menu-open {
overflow: hidden; /* Prevent scrolling */
}
/* Style the menu container content */
.wp-block-navigation__responsive-container-content {
box-sizing: border-box; /* Include padding in the element’s width */
}
/* Style the menu items */
.wp-block-navigation__responsive-container-content ul {
padding: 0;
margin: 0;
}
.wp-block-navigation__responsive-container-content li {
padding: 10px 20px; /* Add padding around menu items */
}
/* Ensure links within the menu are styled correctly */
.wp-block-navigation__responsive-container-content a {
color: #fff; /* Set the link color */
display: block; /* Ensure the link fills the entire menu item */
}