[Support request] Site Header – Different for Logged out and Logged in

Home Forums Support [Support request] Site Header – Different for Logged out and Logged in

Home Forums Support Site Header – Different for Logged out and Logged in

  • This topic has 10 replies, 2 voices, and was last updated 1 week, 1 day ago by David.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #2219366
    John

    Hi,

    RE: Origamispirit Membership

    My GP setup is two years old with hardly a change and I’m just beginning to learn about elements.

    My first challenge is developing a site header that has a different logo depending on whether someone is logged out or logged in.

    How can this be done?

    Thanks!

    John

    #2219576
    David
    Staff
    Customer Support

    Hi there,

    you can use a Header Element:

    https://docs.generatepress.com/article/header-element-overview/

    The Site Header tab has the option to add a different logo.
    You can the set the Display Rules > Location to: Entire Site and User to: Logged in.

    #2219666
    John

    Hi David,

    Clicking the Siteheader tab in Elements the ‘Site Logo’ and ‘Retina Logo’ upload options do not appear on my dashboard.

    Why is that?

    Thank you,

    John

    #2219679
    John

    I now see that those options appear when the site header is merged with a page hero.

    #2219986
    David
    Staff
    Customer Support

    Odd – it should be there by default:

    2022-05-15_11-53-36

    Which versions of GP and GP Premium are you running ?

    #2220076
    John

    I have auto-updates and am currently at version 2.1.2.

    As it turns out, I discovered that when a logo was uploaded through the customizer, the ‘Site Logo’ option to upload/remove appeared. I did not have a logo uploaded previously having relied on the Site Title appearing in the Site Header.

    #2220088
    David
    Staff
    Customer Support

    Aah yes, that explains it – if there is no Customizer > Site Identity -> Logo set to display then there is no option in the Elements.

    So are you wanting to have no logo for one login state and a logo for the other state ?

    #2220112
    John

    What I was aiming for was a logo with one color for logged out and another color for logged in.

    This would also go along with differently colored page heroes depending on login status

    My solution was to create two elements: One site-header/page-hero for logged out; another for logged in.

    I’m not sure this is the best way to solve this but that’s what I came up with.

    #2220378
    David
    Staff
    Customer Support

    So is the content of the hero and the words in the title identical ? And its just the colors that change ?

    #2220410
    John

    “And its just the colors that change?”

    Yes.

    #2220896
    David
    Staff
    Customer Support

    I am not sure if this a better solution but you can use CSS to restyle certain elements.
    First off WordPress adds a CSS classes to the <body> element that can be used to identify various templates, taxonomies, features etc. And this includes the logged in status.

    For example:

    .logged-in #masthead {
        background-color: #f00;
    }

    This will change the site header background for a logged in user.

    Or if you edited a Hero Element and gave it a Element Class eg. my-custom-hero you could do:

    .logged-in .my-custom-hero {
        background-color: #f00;
    }
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.