Site logo

Archived topic

Mobile Menu and Search

10 replies · Started by Scott on October 3, 2021

Viewing posts 1–11 of 11

Hi

I'm having issues with the mobile menu and search not working on 2 sites.

- Everything works fine when I am logged into Wordpress. But when logged out or accessing via private browsing the issue persists (ensuring all caches are cleared). Do you know why this would occur?
- Both sites are running Siteground Optimizer, which I understand is a likely cause based on this discussion. I have been able to get the mobile menu working (but not search) for Site 1 by excluding main.min.js from optimisations. I've done the same for Site 2 with no success. Are there any other exclusions you recommend trying?

Thanks!

Hi there,

For the first site:

It's returning an error as shown here when I try to click the search icon - https://share.getcloudapp.com/4gul6mm1

It only happens on the front page. I'm not exactly sure which is the culprit but it's likely a script issue. Can you try disabling ALL plugins except GP Premium and see if the search starts working? Try excluding by doing a wildcard on GP premium's folder if the plugin allows it. Example /wp-content/plugins/gp-premium/*

For the second site:

It's not returning the same error but WP Rocket seems to be messing w/ the scripts involved. I've tested it by bypassing WP Rocket using ?nowprocket=1 and the page's search function worked smoothly. I'd try excluding the scripts here as well.

Thanks Elvin

Site 1:

I've deactivated all plugins except GP Premium and the issue remains on the home page.
Also, the search function doesn't work on any page on mobile.

SG Optimizer doesn't allow a wildcard exclusion unfortunately but I presume this isn't the cause as the issue persisted when it was deactivated.

Also, the "open-sans-condensed-v15-latin-700.woff2" errors seem to be caused by me trying to locally host fonts as discussed here. The font file is the one I uploaded. But I'm sure I've deleted everything related to that (font files, Snippets, CSS) so not sure why its appearing there.

I also don't understand why the navigation font is appearing differently on the home page vs the rest of the site.
When I'm in Customizer it appears the same as the rest of the site so maybe a caching issue??

Site 2:

I'm seeing the same result as you.
However, WP Rocket has been deactivated for several days and I've cleared all caches (SG Optimizer, server, Cloudflare) so I don't understand how this works.

Site 2:

For me, the mobile menu and search is now working on some pages but not others. Home page is not working.

I’m seeing the same result as you.
However, WP Rocket has been deactivated for several days and I’ve cleared all caches (SG Optimizer, server, Cloudflare) so I don’t understand how this works.

SG Optimizer is quite tricky to deal with. And It only gets extra complicated with CDN cache (Cloudflare) and another caching plugin (WP Rocket).

Site 2:

For me, the mobile menu and search is now working on some pages but not others. Home page is not working.

As I've mentioned on the previous reply. It seems to have something to do w/ the optimization plugins involved.

On this video here, - https://share.getcloudapp.com/bLuqXz9W - I've loaded the home page twice.

The first test was w/ wp rocket on. You can see that the site's mobile menu toggle wasn't showing up.

On the same video, you will also see that I've reloaded the page. The reloaded page had ?nowprocket=1 parameter which effectively disables WP Rocket temporarily for testing purposes.

On the reloaded page, you can see that the menu is working properly.

That said, you may have to tweak some settings within your plugins. Try to disable as many settings within it as possible to see what works. Also make sure to purge cache every time you do any changes. :D

And this idea applies to the first site as well. IF you've deleted all the snippets and is sure that you don't have a child theme w/ snippets in its functions.php then it may be some sort of deep/page caching.

Make sure you purge CDN cache, server-cache(if any) and plugin cache.

Thanks Elvin

You've prompted me to dig deeper into caching, and in addition to clearing out the cache from Cloudflare, the SiteGround Optimizer plugin and the Dynamic Cache I must also remove the WordPress cache in Siteground Site Tools Site > File Manager > public_html > wp-content named Cache. I wasn't aware of the final one.

This has fixed almost all the problems discussed.

One issue is remaining - the search function for Site 1 only seems to be working on the home page (on both desktop and mobile).

One issue is remaining – the search function for Site 1 only seems to be working on the home page (on both desktop and mobile).

I just checked the other pages and they seem to be working on my end as shown here - https://share.getcloudapp.com/yAuyppKv.

Perhaps you've sorted this out already?

Sorry it is working on the home page and category pages but not on on individual posts.

It's likely a caching issue as well.

I'd consider disabling merge/aggregate JS and test from there to see if it works. :D

I apologize if this seems like a non-answer. SG optimizer can be tricky to deal with as it's an integrated plugin to its host/server unlike the usual ones (WP Rocket, Autoptimize). There's a lot to check and debugging is basically a trial and error between the plugin and the server settings, which to be frank is outside of the theme's scope. :)

Finally got this fixed.

Excluded the following from "Combine JavaScript Files" and "Defer Render-blocking JS" in SG Optimizer

/themes/generatepress/assets/js/main.min.js

/themes/generatepress/assets/js/navigation-search.min.js

To add: if SG optimizer allows for wildcard, you may have to exclude the scripts from /plugins/gp-premium/* as well. :D

Nice one. Thanks for letting us know.

Glad you got it sorted. :D

This archived topic is closed to new replies.