[Hummingbird] Caching Issue

We used Weglot for multi-language, and there is its language switcher in the navigation menu, same on mobile.

When page cache is activated, everything on desktop is fine, but on mobile version, the language switcher will not work, instead of showing the actual button, it displays the short code of the widget.

I first troubleshoot with clear the page cache, then load the website on mobile phone, the language switcher is fine, once I go to a different page, it stops working and shows the shortcode. If I just deactive the page cache function, then everything fine again.

Wondering if there is a way to exclude the language switcher from being cached?

  • Nahid

    Hey Ninja Care !
    Hope you are having a great day!

    I'm sorry to hear about the issue that you're encountering. It seems the Weglot shortcodes are somehow not fully compatible with Page Caching.

    Unfortunately, specific elements cannot be excluded from Page Caching in the Hummingbird plugin at the moment. However, this can be resolved in a different way. In order to achieve the resolution, I have duplicated your existing menu "main-nav" to a new menu named "main-nav-2" in your WordPress Dashboard->Appearance->Menus.

    In the newly created "main-nav-2", I have replaced the Weglot shortcodes with actual outputs of the shortcodes for the menu items and have added the required CSS classes so that the flags for the respective locales show up correctly. At last, I have assigned the "main-nav-2" to be the "Mobile Menu" of the site. Here's a screenshot for reference:

    As a result, even when Page Caching is enabled now in Hummingbird, a mobile view will still display the language switcher correctly within your navigation menu. Here's a screenshot for reference:

    Hope this helps. Please let me know if this works for you. Thanks!

    Kind regards,
    Nahid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.