How to avoid multiple navigation structures

  • A customer of mine is SEO expert and very, let’s say demanding regarding the HTML structure. I like it lean and mean. This is why I love GP. However, my customer finds it bloated. Well, customer is king. He wants to have just one navigation structure. By default, we have one block for desktop and one for mobile. Which makes sense, of course. Is it even possible to use just one single navigation block?

  • Hi there,

    Yes, that’s possible.

    If the issue is that the HTML is still being output even when the mobile navigation is hidden on desktop (and vice versa), you can use the Conditions feature to control each block by breakpoint.

    Because the block conditions are evaluated at the server level, the markup won’t be rendered on the frontend at all when the condition is set not to display. This avoids hidden HTML still being present in the page source.

    In your case, you’ll likely want to use the Device Type condition:
    https://learn.generatepress.com/blocks/block-guide/getting-started-generateblocks/generateblocks-pro/conditions/#device-type

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.