This topic has 6 replies, 3 voices, and was last updated 3 months, 1 weeks ago ago by Andrew Mitchell
Hi there,
Could you please assist me with setting the first item in the mobile menu to be toggled open by default?
I tried looking for the appropriate hook to achieve this but haven’t had any success. My goal is for the first item to expand by default, allowing users to view its options right away, while still being able to interact with the other menu items as usual.
I attempted to handle this with CSS, but it caused the menu item to stay open permanently, even when users tried to close it or open another item.
Thank you for your help!
Dear Kay,
We hope this message finds you well. We are currently experiencing difficulties accessing your website and kindly request that you temporarily disable the firewall. This would greatly assist us in proceeding with our necessary tasks.
For your reference, the website in question is: [https://prnt.sc/m9gOXwcSrEho](https://prnt.sc/m9gOXwcSrEho)
We appreciate your prompt attention to this matter and thank you in advance for your cooperation.
Best regards,
The 8Theme’s Team
We have temporarily lifted the block to ensure ease of access. Kindly let us know once you have completed the necessary tasks, and we will reactivate the firewall.
Thank you for your help
Hi @Kay,
Please add the following code under functions.php file locates in your child theme:
add_action('wp_footer', 'n2t_wp_footer');
function n2t_wp_footer(){
?>
<script>
jQuery( function($){
$(document).ready(function(){
setTimeout(function(){
$('.header-mobile-menu li.menu-item-106323').addClass('over');
$('.header-mobile-menu li.menu-item-106323 .nav-sublist-dropdown').show();
}, 500);
})
});
</script>
<?php
}
Hope it helps!
it worked! thanks a lot for the help.
Dear Kay,
In the spirit of gratitude, we want to express our appreciation for your trust in our products. As a valued customer, your experience matters greatly. Would you consider sharing it by giving our theme a deserving 5-star rating on ThemeForest?
Click here to share your thoughts: https://themeforest.net/downloads
Being part of our community means a lot, and your feedback contributes immensely.
Best Regards,
The 8Theme Team
Tagged: assistance, default toggle, first item, mobile menu, templates, woocommerce, wordpress
The issue related to '‘Assistance with Default Toggle for First Item in Mobile Menu’' has been successfully resolved, and the topic is now closed for further responses