I have a primary menu which is displayed for desktop
<?php
//Show the navigation menu
wp_nav_menu(array(
'theme_location' => 'primary-nav',
'menu_class' => 'navigation d-block',
'walker' => new My_Walker_Nav_Menu()
));
?>
And this is the menu for mobile
<?php
//Show the navigation menu
if(wp_is_mobile()) {
wp_nav_menu(array(
'theme_location' => 'mobile-menu',
'menu_class' => 'main-ul'
));
}
?>
How can I add a href="javascript:void(0)" for the mobile menu? Menu is:
About ˅
-child
News
Contact
I want if in mobile when About is clicked to show the child and not link you to About page.