Menu Mobile

Hi there! Love your themes, keep up the great work. I’m trying to figure out why my secondary level menu items don’t show up.

Could you tell me where I’m going wrong: 2677.dylanlongpre.ca

Thanks so much!

@djgl13

First of all you have Font Awesome icons loaded twice. Once they are loaded with theme and then again loaded from CDN using some plugin but I am not sure which one. Make sure to get rid of those.

Also try to disable all plugins to see if it resolves this problem. If so, enable one plugin by another to see which one causes the issues. You have far more plugins installed than you should be using for a tiny website like this. The more plugins you have the slower is your website and the higher is the chance that something won’t work.

Let me know if this helps.

Thanks for the quick reply - you the man.

Disabled the plug-ins, wasn’t sure how to remove the Font Awesome, so I took the plugins off my FTP for now to troubleshoot.

I did make a change in the menus so you could click the top level menu items in addition to the secondary level items (on the desktop version), read a previous post on how to do it (https://colorlibsupport.com/t/top-level-header-item-is-not-linking-to-a-page/)

Does that affect the mobile version? Could that be the problem?

Turns out that this actually affects dropdowns on mobile. Thank you for reporting!

Here is a better solution for the same problem:

if ( $args->has_children && $depth === 0 ) {
        $atts['href'] = ! empty( $item->url ) ? $item->url : '';
        $atts['data-toggle']        = 'dropdown';
        $atts['class']                        = 'dropdown-toggle';
} else {
        $atts['href'] = ! empty( $item->url ) ? $item->url : '';
}

Where do you put this code, I am having the same problem.

Thanks,

Robert

Hey Robert,

It’s the navwalker.php file.

Cmd+F for $args->has_children

I didn’t seem to work. Argh!

Take a look at the original link – https://colorlibsupport.com/t/top-level-header-item-is-not-linking-to-a-page/

And just use the updated code posted above. Best of luck!

Hi,
I’d really like to thank @Aigars for the beautiful theme and wonderful support. =D

I’ve looked for the solution in the support forum and the best solution that I could get for the menu problem is https://colorlibsupport.com/t/top-level-header-item-is-not-linking-to-a-page/
This functions very well in desktop version, but in mobile, everytime the top level menu is clicked, it is automatically going to the destination, without giving time to click for the submenu.

So, I look for another solution and ends up here, When I tried:

if ( $args->has_children && $depth === 0 ) {
        $atts['href'] = ! empty( $item->url ) ? $item->url : '';
        $atts['data-toggle']        = 'dropdown';
        $atts['class']                        = 'dropdown-toggle';
} else {
        $atts['href'] = ! empty( $item->url ) ? $item->url : '';
}

Unfortunately, it functions just the same as the original. The top level menu can’t be clicked, either in desktop or mobile version.

I tried it using iPad (just in case safari and other mobile browser system is different).
I also have tried going to @djgl13’s site (2677.dylanlongpre.ca) and the problem exists there too.
Here is my website: http://esviai.com

I really appreciate your help. Cheers!

On my site, I had to compromise because you can’t do a roll over on a mobile device. The last code from @Aigars was the best fix for me. I agree with @esviai, thanks for the awesome support. Someone buy this man a beer! Cheers!