/*wp_block_styles_on_demand_placeholder:69b3bbbb2f0d2*/ /*# sourceURL=wp-block-library-inline-css */

How to show Divi Mega Menu on desktop only

We have had a few customers wanting to show the Mega Menus on desktop only. By default, Divi Mega Menu shows it on desktop and mobile. This tutorial will show you how to hide it on mobile.

Step 1:

Create your Divi Mega Menu in the Divi Engine settings as usual. Here is a link to our documentation on how to set this up.

Step 2:

Create two menu items and assign the mega menu custom identifier (CSS class) to the one you want to show for desktop. Assign another custom class to the other that you want to show for mobile. I have added the class “mobile-only” – but it can be anything. See image below. I have labeled the menu items “Mega Menu Desktop” and “Menu Mobile” to be clear on what is happening.

If you go to the front end of your website you will still see both menus like below
Divi Mega Menu
Divi Mega Menu

Step 3:

We are doing to add some custom CSS to hide the mobile menu on desktop and hide the desktop on mobile. Below is the CSS and my comments on what each line does.
[css]
.mobile-only {display:none !important;} /*this hides the mobile menu on desktop */

@media all and (max-width: 980px) { /* You can change the breakpoint from 980px to when your mobile menu comes in */
.mobile-only {display:block !important;} /*shows mobile menu on mobile */
.test {display:none !important;} /* hides desktop menu on mobile, make sure you change the word test to be the custom css class you gave for your mega menu */
}
[/css]
Below is how it looks on the frontend now.

Divi Mega Menu
Divi Mega Menu
And that’s it! Any questions just comment below or get in touch and we will be happy to help 😀

0 Comments

Submit a Comment

Explore more from Divi Engine

Divi Form Builder

Divi Form Builder

From simple contact forms to complex frontend post or product creation, Divi Form Builder has you covered.

Divi Form Builder
Find out more
Divi Machine

Divi Machine

Build complex websites that displays dynamic fields you can filter, search and so much more with the Divi Builder.      

Divi Machine
Find out more
Divi BodyCommerce

Divi BodyCommerce

A versatile toolkit for developers using Divi and WooCommerce together, designed to boost your e-commerce site and achieve greater conversion rates.    

Divi BodyCommerce
Find out more
Divi Handoff

Divi Handoff

Let clients update content without touching the Divi Builder. Design layouts once, connect them to Flexible Content fields, and give editors simple forms for text, images, and sections.

Divi Handoff
Find out more
Divi Loop Extender

Divi Loop Extender

Unlock the Full Power of Divi 5 Loop Builder Add advanced sorting, filtering, and relationship logic right inside the Visual Builder.

Divi Loop Extender
Find out more
Divi Membership

Divi Membership

Monetize your Divi websites by transforming them into membership sites with seamless subscription management, user-friendly interfaces, and customizable membership tiers.

Divi Membership
Find out more
Divi Machine Accounts

Divi Machine Accounts

Build an account area for your customers to edit their details, access wishlist, submitted posts and more. *Note: Requires Divi Machine installed and active

Divi Machine Accounts
Find out more
Divi Ajax Filter

Divi Ajax Filter

Filter WooCommerce, Posts & Custom Posts without reloading the page.    

Divi Ajax Filter
Find out more
Divi Mobile

Divi Mobile

Divi Mobile helps you create beautiful looking mobile menus without having to code.

Divi Mobile
Find out more
Divi Nitro

Divi Nitro

Give your Divi website that extra boost of speed with our Divi Nitro plugin to enhance your customer's experience.

Divi Nitro
Find out more
Divi Protect

Divi Protect

Password protect the content of your Divi website with our Divi Protect plugin. Keep unwanted eyes out!

Divi Protect
Find out more
Divi Mega Menu

Divi Mega Menu

Create stunning, responsive, and content-rich mega menus using the Divi Builder you already know. No coding required.  

Divi Mega Menu
Find out more