Changing a Submenu to a Mega-menu with Beaver Builder

Code Snippet Related Categories

Reason for needing the Code Snippet

Sometimes you want to present a navigation menu as a horizontal “mega-menu” instead of a hierarchal dropdown menu. This is really simple if you are using Beaver Builder. The mega-menu feature is built in, but is unfortunately hidden. You have to know the secret to turn it on.

(This post was viewed 815 times) in the last month.)

What the Code Snippet does

Converts a submenu dropdown to a full-width horizontal mega-menu.

What the page looks like Before and After

Here's the Code Snippet

 

  • Step 1: make sure you turn on the CSS Classes in Screen Options when viewing your WordPress Menus
  • Step 2: for the parent menu item (for the submenus you want to be mega-menu) add "mega-menu" as the CSS Class (no quotes) In this example the Parent Menu Item is "Categories"
  • Step 3: Save your Menu
  • Step 4 if you want the mega-menu to be full width, then add the following CSS and tweak as necessary:

UL.fl-menu-horizontal LI.mega-menu > UL.sub-menu:after
{
 content: "";
 display: block;
 position: absolute;
 left: 50%;
 top: -1px;
 height: 101%;
 width: 100vw;
 transform: translateX(-50%);
 z-index: -1;
 box-sizing: border-box;
 border-top: 1px solid #efefef; 
 background-color: #efefef;
 /* This is for full width shadow.
 You need to turn off "sub-menu drop shadow" in the menu module.
 Remove this if not needed. */
 -moz-box-shadow: -2px 4px 9px 0 rgba(134, 134, 134, 0.451);
 -webkit-box-shadow: -2px 4px 9px 0 rgba(134, 134, 134, 0.451);
 box-shadow: -2px 4px 9px 0 rgba(134, 134, 134, 0.451); 
}

 

Limit search for phrases by using " " around the phrase

Subscribe to Code Snippet updates

You will get an email the morning after we post a new Code Snippet

Something went wrong. Please check your entries and try again.

Other Recent Code Snippets

Using the Right Tools Makes All the Difference 1

Using the Right Tools Makes All the Difference

Posted in , , , ,

The Start of a New Website Project Master Roofing Company  is a family-owned and operated Oakland roofing contractor with nearly 40 years experience of servicing residential and commercial clients in and around the San Francisco Bay Area. They had a Yelp page, but they didn’t have their own website. The […]

Read More
WordPress Resources at SiteGround 2

WordPress Resources at SiteGround

Posted in , , , ,

WordPress is an award-winning web software, used by millions of webmasters worldwide for building their website or blog. SiteGround is proud to host this particular WordPress installation and provide users with multiple resources to facilitate the management of their WP websites: Expert WordPress Hosting SiteGround provides superior WordPress hosting focused […]

Read More
How to embed a viewable pdf in a WordPress post 3

How to embed a viewable pdf in a WordPress post

Posted in , , , ,

Normally putting the URL of a pdf on a line by itself doesn’t display the pdf on a Word­Press page, and if you use the add media button and paste the URL for the pdf into the URL field, you get a link that will open the pdf, but the pdf does not display on the page itself,

Read More
Trouble moving your site to Godaddy Managed WordPress Hosting Plan? - Here are some pointers 4

Trouble moving your site to Godaddy Managed WordPress Hosting Plan? – Here are some pointers

Posted in , , , , ,

Recently a reader raised a question in a comment to a previous post. He was confused about how to move an existing site to Godaddy Managed WordPress Hosting. Having done this several dozen times now I’ve developed some “best practices” and work-arounds I can share.

Read More
Google filters out websites that are not mobile-friendly from search results - how to check your site 5

Google filters out websites that are not mobile-friendly from search results – how to check your site

Posted in , , , ,

Google has started rolling out filtering for Google searches from mobile devices. If you site doesn’t meet the criteria for mobile-friendly, your site won’t show up in the search results no matter how relevant your page is to the search. As more folks are visiting websites using smartphones and tablets […]

Read More
Is it time to give GoDaddy WordPress hosting another chance? 6

Is it time to give GoDaddy WordPress hosting another chance?

Posted in , , , , , , ,

Hosting your WordPress website on GoDaddy has been strongly discouraged by me and most of the WordPress consultants I know. But GoDaddy has just introduced a new WordPress Managed Hosting plan that may change all that.

Read More

Pieter Hartsook

WordPress website coaching, design, implementation, support, and training. Background in Marketing Research and Communications. See my profile at: https://www.linkedin.com/in/hartsook/

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *

Skip to content