Black Friday Sale! Get up to $40 off GP Premium!Learn more

[Resolved] Changing logo in Nav menu

Home Forums Support Changing logo in Nav menu

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #373364
    Max

    Hey Tom

    I hope your and your family are well.

    Could you please provide me with the CSS to change the Navigation menu logo on a page by page basis.

    Here’s why

    I have created a home page with a custom header. I have merged with the site header. Nav menu positioned above the header. The header background image is black. My menu background color is white and my navigation logo is black. However on the merged header I use a transparent background for the menu. The result is a black logo on the black header background.

    What I want is to use a white version navigation logo just on the (merged header) home page, and then the black version on other pages.

    Thanks in advance for your kind assistance.

    Kind Regards

    Max

    GeneratePress 1.4
    GP Premium 1.4.3
    #373402
    Max

    In your documentation I found the following for changing the site logo for a specific page.

    add_filter( 'generate_logo','tu_custom_about_logo' );
    function tu_custom_about_logo( $logo )
    {
     	// If we are on the about page, set our custom logo
     	if ( is_page( 'about' ) )
     	 	return 'URL TO OUR LOGO IN HERE';
    
     	// Or else, set the regular logo
     	return $logo;
    
     }  

    Is there a filter for changing the navigation logo for a specific page?

    That is what I am after.

    Kind Regards

    Max

    #373406
    Leo
    Staff
    Customer Support

    Hi there,

    Have you tried the Page Header Logo option: https://docs.generatepress.com/article/page-header-logo/

    Let me know if this helps.

    #373421
    Max

    Thanks Leo

    Yep that’s it. A bit of a trap that the meta box does not appear until after you have uploaded a nav logo.

    How is one supposed to know that the functionality is there if one cannot see it?

    #373432
    Max

    Oh but hang on…that’s not it.

    I am not using a site logo. Just the nav bar above the header with a nav logo (as my site logo).

    So it does not work:

    1. I have a black nav logo on a white nav background (set to appear on both static and sticky)
    2. Merged header on home page has black background. Nav background on homepage set to transparent. Thus black nav logo invisible (black on black).
    3. If I change to white logo via meta box option, logo is visible when home page static (white on black), but when user scrolls nav background changes to white and then white logo invisible.

    So I guess I need to expand a little on my original question:

    Is there a filter to change a nav logo on a specific page AND scrolling (change logo in sticky menu)?

    Thanks is advance for your help.

    #373467
    Leo
    Staff
    Customer Support

    In that case you would have to do something like this:
    https://generatepress.com/forums/topic/change-logo-media-source-file-when-sticky/#post-304545

    with similar if ( is_page( 'about' ) ) you have above.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.