Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Mega Menu with GeneratePress Blocks & Hook – Layout and Submenu Sty

  • I’m building a mega menu system using GeneratePress Premium, the Block Element (Hook) feature, and the standard WordPress menu system.
    Here’s what I’m doing:
    I have a top-level menu item (e.g., “Shop”) with the class has-mega-menu.

    Under it, I add a submenu custom link labelled ##mega_menu_shop##, with the class mega-menu-item.

    In the code snippets plugin, I use the walker_nav_menu_start_el filter to detect the title and replace it with:

    php

    <div class=”mega-menu-content”><?php do_action(‘mega_menu_shop’); ?></div>

    The mega_menu_shop action calls a GeneratePress Block Element (Hook), which allows me to design the mega menu layout using containers, grids, and dynamic blocks visually.
    The issue I’m facing:
    The injected .mega-menu-content inherits default submenu styles from GeneratePress, which:

    Restricts its width like a standard dropdown

    Prevents proper centering and full-width display

    Causes layout shifts or stacking issues

    Despite trying several CSS approaches, I haven’t been able to override this behavior cleanly while preserving semantic structure and accessibility.
    This is part of a scalable eCommerce project, and I plan to reuse this method for multiple menu items using different hook names. If possible, I’d really appreciate it if someone could take a quick look and help adjust the structure or CSS so the mega menu displays properly centered, responsive, and wide (e.g., max-width: 1200px).
    Thanks so much.

  • Anwar A. Mzee

    Hi team,

    I am following up on my support request submitted two days and seventeen hours ago. I haven’t received a response yet, and this is a fairly critical feature for our project.

    Would appreciate it if someone could take a quick look and advise. All relevant details are in the original ticket.

    Thanks in advance,

  • Hi there,

    Apologies for the delayed response, your topic slipped through our ticketing system.

    This looks like a custom solution. Could you let us know where you originally found the article you mentioned?

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