Archived topic
Switching logo, header bckgrnd color, link color, menu, and menu text color
3 replies · Started by William on October 5, 2022
For two sections of the site, client would like to switch the logo, header background color, link color, menu (which menu is shown), and menu link text color.
e.g. any pages within /abc/* would get the swapped branding/ menu/ colors
I was thinking of using Elements > Site Header
but that only gets the logo swapped
What's the best way of approaching this?
Many thanks in advance!
Hi William,
To clarify, are you referring to sections of a page, or in two pages?
Can you also share the link to the site in question?
You may use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
Let us know.
Hi,
Any pages within /abc/* would get the swapped branding/ menu/ colors
i.e.
This part of the site would get logo branding/ menu/ colors to reflect ABC
www.sample.com/abc
www.sample.com/abc/page1
www.sample.com/abc/page2
www.sample.com/abc/subpage/page1
This part of the site would get logo branding/ menu/ colors to reflect XYZ
www.sample.com/xyz
www.sample.com/xyz/page1
www.sample.com/xyz/page2
www.sample.com/xyz/subpage/page1
All other pages outside those two directories would receive the logo branding/ menu/ colors of the main site.
I've had partial success using 'WPCode – Insert Headers and Footers' plugin to override CSS for those two directories; and using Elements > Site Header ...but that only gets the logo swapped. Also that doesn't let me set the ALT, TITLE, or URL for that alternate logo, so this solution isn't 100%.
Looks like I may be able to leverage the 'Conditional Menus' plugin.
Many thanks!
I see. Thank you for clarifying.
So, for logos, there's a filter you can use: https://docs.generatepress.com/article/generate_logo_output/
If you set a specific category for ABC and XYZ, you can have a conditional if/else statement in the filter based on that. Otherwise, if you want to base it on the URL, you'll need to check the current URL(ex: https://wordpress.stackexchange.com/questions/274569/how-to-get-url-of-current-page-displayed#:~:text=You%20may%20use%20the%20below%20code%20to%20get%20the%20whole%20current%20URL%20in%20WordPress%3A) then set a conditional statement based on this instead.
As for the colors, you can create a Hook Element with <style> tags for the CSS, and then set it to display on specific categories ABC or XYZ. Otherwise, if it will be based on the URL as well, you'll need to filter the Hook Element display rules: https://docs.generatepress.com/article/generate_element_display/