- This topic has 10 replies, 2 voices, and was last updated 1 year, 11 months ago by David.
-
AuthorPosts
-
May 14, 2022 at 7:43 am #2219366John
Hi,
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
May 14, 2022 at 8:20 am #2219576DavidStaffCustomer SupportHi 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.May 14, 2022 at 10:51 am #2219666JohnHi 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
May 14, 2022 at 11:28 am #2219679JohnI now see that those options appear when the site header is merged with a page hero.
May 15, 2022 at 3:54 am #2219986DavidStaffCustomer SupportMay 15, 2022 at 7:01 am #2220076JohnI 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.
May 15, 2022 at 7:10 am #2220088DavidStaffCustomer SupportAah 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 ?
May 15, 2022 at 7:36 am #2220112JohnWhat 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.
May 15, 2022 at 8:18 am #2220378DavidStaffCustomer SupportSo is the content of the hero and the words in the title identical ? And its just the colors that change ?
May 15, 2022 at 8:51 am #2220410John“And its just the colors that change?”
Yes.
May 16, 2022 at 3:10 am #2220896DavidStaffCustomer SupportI 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; }
-
AuthorPosts
- You must be logged in to reply to this topic.