• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Different menu for mobile

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Different menu for mobile

This topic is: not resolved

Tagged: css, menu, minimum pro, responsive

  • This topic has 2 replies, 3 voices, and was last updated 6 years, 1 month ago by chrisbrandon.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 30, 2017 at 8:20 pm #204088
    fgrondon
    Member

    Is there a way to show a different menu when the site is viewed from a mobile device?

    I would like to show certain menu items when viewed from a desktop and different ones when viewed from a mobile device.

    I am using minimum pro

    March 31, 2017 at 5:34 am #204105
    Victor Font
    Moderator

    This is tricky, but it is doable. Menus are generated by PHP, a server-side process. PHP does not know or care what type of device your site is being accessed by. PHP generates code. That's all.

    Client side, jQuery/JavaScript have access to the Document Object Model or DOM. The DOM is the object that contains all of the information pertinent to the device and mobile access. CSS also executed client side in the browser.

    There are two ways that I know of where you can swap the menu. First, you could have a completely separate menu for mobile that is generated by PHP through a jQuery Ajax call after the page is initially loaded. This will be inefficient and cause a slight delay in the page display.

    Second, you can create a single giant menu and assign different classes to the desktop and mobile items. Using jQuery, you can determine the device display and hide/show the menu items by looping through the menu and displaying the appropriate items. Don't forget to add the classes to sub-menus also, otherwise the display will be screwy.

    As for the code, this will take a lot to figure out, maybe as much as half a day. If you're not too skillful with jQuery, you may want to think about hiring a developer.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    March 31, 2017 at 10:14 am #204122
    chrisbrandon
    Member

    There are several plugins that do exactly what you're looking for. I used ShiftNav on one of my sites.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble