CSS classes not adding/generating - Solved, was Object Cache Pro

Hi there,

Had an odd one that I can’t figure out.

It’s on https://jafqkkce24-staging.wpdns.site/
I’ve built a megamenu which has a component (with paramaters and a slot for the top nav items) and then a component inside that slot (which is a row/div).

It mostly works fine (I’ve done the same setup on https://alderney-elec.com/ ) but for some reason it occasionally loses the generated classes. You can see it’s fine in the builder but not on the front end:

Screenshot 2026-07-21 at 09.36.32

Oddly, this has happened in every row at different times. No matter what I tried, moving the columns, changing what’s inside them, there’s no open loopers, consumers, or anything like that. Initially, I thought it might have been the row wasn’t set to 100%, but I did that, thought it fixed it, and it didn’t, so it seems to happen okay for a while. I’ve cleared all caches, done all the normal stuff.

Happy to provide login details if needed!

Hello @RubberDuckers,

Thanks for writing to us.

It might be an issue of broken HTML or a custom code issue. I suggest you clone the header and delete the elements one by one to determine which one is causing the issue. I also suggest troubleshooting a few common issues using our common issue guidelines. If it doesn’t work for you, please share your details in a secure note. Please provide the following details

  • WordPress Login URL
  • Admin-level username and password
  • Exact page URL and layout URL

You can find the Secure Note button at the bottom of your posts

Thanks

Thanks @prakash_s - I’d already done all that - tried everything I can think of. So I’ll add you guys to it

Hello @RubberDuckers,

It seems that there may be a cache issue. I cleared all the cache, including the CDN cache, and it is working fine on my end at the moment. Please clear your browser cache and check it again.

Thanks

Hey Prakash, I have done that multiple times - tried in incognito, other browsers etc and both myself and the client have been able to replicate.

Did you not do anything else? Feel free to change some things (as the client has been) and see if you can recreate as its been going on weeks now.

Hello @RubberDuckers,

I purged the CDN cache from your WordPress dashboard, and it is working fine on my end at the moment. I have tested in Google Chrome browser version 150.0.7871.129. Please check the given screen recording. Please let us know the browser and its version so we can check it on our end.

Thanks

Hey @prakash_s - yeah I’d done that. Did you move anything around though?
I just moved things around, cleared the cache (which then showed me the things had moved) but it’s now broken. Take a look.
I’ve cleared a few times, tried different browsers, hard refreshed, etc.

Hello @RubberDuckers,

It seems that the map image position was moved to the beginning of the mega menu dropdown, which is not loading properly. I disabled all the mega menu items by selecting the eye icon in the element settings, and then re-enabled the elements one by one to check the broken HTML, but it is working fine now.

Hope it helps
Thanks

Hey @prakash_s - Yes, I moved them so you can see what I mean.

If the client moves things around (as they will do as they change their menu etc) why is it breaking?

They shouldn’t have to disable/enable it each time for it to work - what’s the underlying issue?

Thanks

Hey @RubberDuckers,

I’ve been following the thread regarding the missing CSS classes on the megamenu and the issue reappearing after moving elements. Thank you for detailing the troubleshooting steps you’ve taken so far.

While the temporary fix (disabling and re-enabling elements) confirms the CSS can regenerate, the fact that it fails again after content changes points to a few specific, persistent triggers. Here are the most likely root causes we’ve encountered in similar cases.

Root Cause Analysis

  1. Persistent Caching Layers (Most Likely):
  • The Problem: The most common culprit is a caching layer that is not being completely purged. This could be your WordPress caching plugin (e.g., WP Rocket, W3 Total Cache), server-side caching (like Varnish or Redis), or a CDN that still has stale assets cached.

  • Why it happens: When you update the menu in Cornerstone, the theme regenerates a dynamic CSS file. However, if the old file is still being served by a cache, the new CSS classes (or changes to them) never make it to the browser.

  • The Fix: You need to ensure all caching mechanisms are purged simultaneously. Try temporarily disabling all caching plugins and CDN services and then test if the issue persists. If it stops, you’ve found the source. You may need to add a rule to your caching/CDN configuration to exclude Cornerstone’s dynamic CSS files from aggressive caching.

  1. Server Resource Limits During CSS Regeneration:
  • The Problem: Cornerstone’s dynamic CSS generation can be resource-intensive, especially for complex headers/megamenus. If your server has a low PHP memory limit or a short max_execution_time, the generation process may time out or fail silently after you save changes.

  • Why it happens: The old CSS is cleared, but the new CSS isn’t fully generated, leading to missing classes.

  • The Fix: Temporarily increase your PHP memory limit to at least 256MB and the max_execution_time to 300 seconds in your wp-config.php file, then save the menu again to force a regeneration.

  1. Conflicts with Custom Code/Scripts:
  • The Problem: A third-party plugin (like a caching, optimization, or security plugin) or custom JavaScript in your child theme might be interfering with the JavaScript that triggers CSS regeneration after a save.

  • Why it happens: This prevents the system from receiving the signal to rebuild the CSS.

  • The Fix: Perform a conflict test by disabling all non-essential plugins and switching to the parent X theme (without any custom code) to see if the issue resolves.

To isolate the root cause, I would suggest a systematic approach:

  1. Test in an Isolated Environment: Temporarily disable all caching plugins, CDN, and any JavaScript minification/concatenation plugins. Purge all caches (server and CDN). Then, test moving a menu element. If the problem stops, you’ve identified the conflict and can work on adding specific exclusions.

  2. Check Server Error Logs: Immediately after reproducing the issue, check the server’s error logs for any PHP errors, warnings, or memory-related messages. This will provide the clearest evidence of the problem.

  3. Regenerate CSS Manually: In many theme/Cornerstone settings, there is an option to “Regenerate CSS” or “Purge Dynamic Content.” If such an option exists, try using it after each content change, rather than relying solely on caching plugins.

While the “disable and re-enable” method is a valid workaround for a single instance, I agree that it is not a sustainable solution for a client who needs to make regular updates. The goal is to find the trigger that stops the automatic regeneration.

Please let us know if you find anything in the error logs. Sharing the list of active plugins and the server’s PHP configuration details (memory limit, max execution time, and POST max size) would also be very helpful for further diagnosis.

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.