[Resolved] Change background color of menu items on mobile

Home Forums Support [Resolved] Change background color of menu items on mobile

Home Forums Support Change background color of menu items on mobile

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1638524
    David

    Hi,

    I’m totally stuck.

    I need to make it so that, on mobile, when I open the hamburger menu, the options that appear have a background color.

    Sounds fairly simple doesn’t it!?

    But in Customize I cannot find a setting that affects this. I’ve tried changing every single color to red, just so I can identify the relevant field. Everything changes to red, the navigation bar background, the text, the background on hover, etc etc. But the background of those tier-two, un-hovered menu items stays white.

    I’ve set up an admin account. If you could have a look that would be very much appreciated.

    Dave

    #1638530
    David

    Cancel that. It’s bloody working now.

    I’ll update this if I figure out why.

    #1638656
    Leo
    Staff
    Customer Support
    #1639249
    David

    So it turns out my confusion was because Customize – Colors – Primary Navigation – Parent Items – Background controls both the color of the nav bar (if that’s the correct term? I mean the screen-wide section at the top of the page that contains the logo, the menu and the search) AND the color of the menu items.

    This is a problem because it means if I want a white nav bar, when I open the menu I can barely see the options because the background of the options is also white, and only the text is visible.

    Is there any way GP can get round this?

    Thanks,

    Dave

    #1639608
    David
    Staff
    Customer Support

    Hi there,

    can you share a link to your site where we can see the issue.

    #1639888
    David

    Hi,

    It’s wavetothe.site

    I’ll add login details below.

    Thanks.

    #1640747
    Leo
    Staff
    Customer Support

    Hi there,

    Just to confirm, is the issue here that you want the two sections here to have different colors?
    https://www.screencast.com/t/Mm2tpBuOnLH

    If so, uncheck the navigation as a header option in the customizer:
    https://docs.generatepress.com/article/navigation-as-a-header/

    Then set the navigation location to float right:
    https://docs.generatepress.com/article/navigation-location/

    Then you can control the colors of the two sections using the header background color and navigation background color.

    Let me know if this helps πŸ™‚

    #1641549
    David

    Hi Leo,

    That was pretty much the solution, thanks.

    The only remaining issue was that once I’d done the above, the menu disappeared from all pages but the home page. So I changed the function to the following and it seems to be doing the job:

    add_filter( ‘generate_navigation_location’,’to_move_navigation’ );
    function to_move_navigation( $location )
    {
    if ( is_page() ) {
    return ‘nav-float-right’;
    }
    if ( is_single() ) {
    return ‘nav-float-right’;
    }
    if ( is_category( $category = ” ) ) {
    return ‘nav-float-right’;
    }
    }

    Thanks very much,

    Dave

    #1642274
    Leo
    Staff
    Customer Support
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.