Site logo

Archived topic

Using a different menu for a particular page

5 replies · Started by Grace on July 2, 2021

Viewing posts 1–6 of 6

Is there a way to use a different menu/menu bar for a specific web page? I want to keep all the same menu items but I want to style the menu bar differently in background and text colors.

Thanks in advance for your help.

Hi Shane,

You are referring to colors only here right?

If so you can use the CSS here:
https://docs.generatepress.com/article/changing-navigation-colors/

And target the specific page you have in mind.

For example,

.main-navigation {
    background-color: #222222;
}

becomes

body.page-id-xxx .main-navigation {
    background-color: #222222;
}

And

.main-navigation .main-nav ul li a, 
.main-navigation .menu-toggle {
	color: #FFFFFF;
}

becomes

body.page-id-xxx .main-navigation .main-nav ul li a, 
body.page-id-xxx .main-navigation .menu-toggle {
	color: #FFFFFF;
}

Adding CSS: https://docs.generatepress.com/article/adding-css/

Let me know if this helps :)

Hi Leo, Thanks. Using the page ID seems straightforward enough. Not so clear to me on the colors part. I don't see where I'm changing the text color for each, background, hover and current, for both menu and sub-menu.

In Generate Press' customization I am able to style colors and text for "background", "hover" and "current", for both menu and sub-menu. How does this compare to "background" (this one is clear), "active", "focus", and "toggle", shown in the documentation for changing navigation colors?

I don’t see where I’m changing the text color for each, background, hover and current, for both menu and sub-menu.

They should all be in the documentation gist.

The CSS related to search have input[type="search"] in the selector.

Then the rest should have comments to label them:

/* SUB-NAVIGATION */
/* MENU ITEM HOVER */
/* SUB-NAVIGATION HOVER */
/* CURRENT ITEMS */
/* SUB-NAVIGATION CURRENT ITEMS */

Hmmm, okay. I'm going to have to play with this and see what happens.

Thanks, Leo, for your help.

No problem :)

Let me know if you are still stuck.

This archived topic is closed to new replies.