Archived topic
Mobile menu not working
10 replies · Started by Zoltan on October 2, 2022
Hi there,
I am using the dispatch GP premium theme and the mobile dropdown menu is not working on mobile.
Currently, the only time the mobile menu is visible and works are after I am doing a search for any random term in the mobile search bar.
Desktop is fine, the only issue is on mobile.
Can you please take a look?
Thanks,
Zoltan
Hi there,
Any chance you can disable all plugins except GP Premium to eliminate conflicts from other plugins first?
Let me know :)
Hi there,
I disabled all the plugins one by one while checking if the mobile menu works.
Can confirm this was most likely caused by the Litespeed cache - "Load Javascript Deferred" setting turned on.
I am sure this was the cause because I have another site with the same theme and settings, also same Litespeed cache settings, except Javascript deferred off (because the other site is not running ads, so does not need JS deferred)
Do you know any workarounds for this, please?
The reason I need to have javascript deferred is to improve loading speed and core web vitals when running ads javascript on every page. But it will break the GP mobile menu on the premium Dispatch theme.
Please let me know.
Thanks!
To clarify now that I turned off Javascript delayed, the mobile menu works like a charm.
Does it allow you to exclude some scripts?
Yes, it does allow to exclude JS: "Listed JS files or inline JS code will not be deferred. Both full URLs and partial strings can be used."
Can you check with LiteSpeed's support team to see if there is a way to exclude all files from generatepress and gp-premium folder?
I will check, thanks!
Sounds good. Let me know.
I'll keep this topic open.
So the mobile menu now works on both of my Dispatch theme LiteSpeed cached sites, if JS is deferred.
If JS is delayed (this was causing the frontend issue) then the Dispatch mobile menu stops working.
As a quick fix, I changed the setting to JS deferred. It appears Litespeed does not have an option to exclude JS delay scripts only can exclude JS defer scripts.
Thanks, Leo this should work fine now.
Thanks for sharing the result!