Site logo

Archived topic

Different Menu for Mobile

5 replies · Started by Anonymous on February 23, 2015

Viewing posts 1–6 of 6

How would I make an entirely different menu for mobile (in that it will have different url links for a menu item depending on the screen size)?

Hmm, good question..

Here's one way off the top of my head..

First, add this CSS:

.desktop-menu-item {
      display: block;
}

.mobile-menu-item {
      display: none;
}

@media screen and (max-width: 768px) {
      .desktop-menu-item {
            display: none;
      }

      .mobile-menu-item {
            display: block;
      }
}

Then add all of your menu items to the menu.

Click on "Screen Options" at the top right of the menu page, and check the "CSS Classes" checkbox.

Now open each menu item, and add "desktop-menu-item" to the class of each item you want to show on large screens, and "mobile-menu-item" on the items you want to show on mobile screens.

That should do it :)

Hi,
I have the same request than Tiffany.
The additionnal CSS doesn't work, seems to be "display: block!important;" in the theme CSS.
Do you have an alternative?

Hi Leo,
Thanks, it works great!
Regards.

No problem!

This archived topic is closed to new replies.