Site logo

Archived topic

Different Header and Footer on Different Pages

13 replies · Started by John on August 27, 2020

Viewing posts 1–14 of 14

Hi,

I'd like the logged-out header and footer on the pages of a membership site to be one color, and the logged-in header and footer of other pages to be another color.

How can I do this?

Thanks!

Hi there,

I wonder if we can just use some CSS.

The link to your site isn't working for me.

Can you double check?

Any chance you can give a test username/password so I can login to see if there are any classes added to the logged in page?

Do you need administrative access?

REMOVED

Thanks!

Try this to change the logged in color:

body.logged-in .site-header, body.logged-in .site-info {
    background-color: #000
} 

That took care of the Header, but not the footer.
The background color for header navigation also has to be changed.

Edited the CSS above:
https://generatepress.com/forums/topic/different-header-and-footer-on-different-pages/#post-1421069

As for navigation colors, all the CSS is here:
https://docs.generatepress.com/article/changing-navigation-colors/

You just need to add body.logged-in in front of it to target the logged in condition.

For example,

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

becomes:

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

I'm not 100% sure this is right but the main nav had to edited to:

body.logged-in .main-navigation, .main-navigation ul ul,
body.logged-in .main-navigation .menu-toggle{
    background-color: #DDDDDD;
}

And this took care of keeping the hover color the same #DDDDDD

body.logged-in  .main-navigation .main-nav ul li a {
    background-color: #DDDDDD;
}

Awesome :)

You're a good and patient teacher, Leo.

Thank you.

No problem :)

This archived topic is closed to new replies.