Site logo

[Resolved] change logo image on one page

Home Forums Support [Resolved] change logo image on one page

Home Forums Support change logo image on one page

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1874102
    Rob

    Hi,

    I’ve used some custom CSS (using page-id targetting) to change the background color of the navigation bar on a homepage (https://www.yaronengler.com/home/), but is there a way to also change the logo image on this page?

    Standard navigation (colors, logo, etc) are all fine on other pages (eg: https://www.yaronengler.com/programme/), but I’d like the logo to be white just on https://www.yaronengler.com/home/

    Thanks
    Rob

    #1874727
    David
    Staff
    Customer Support

    Hi there,

    it requires some PHP to do that – and to use the generate_logo filter

    https://docs.generatepress.com/article/generate_logo/

    Your code would be something like this:

    add_filter( 'generate_logo', function( $logo ) {
          // Return our category logo URL
        if ( is_page( 42 ) ) {
            return 'URL TO YOUR PAGE LOGO';
        }
    
        // Otherwise, return our default logo
        return $logo; 
     } );

    Change the 42 to match the ID of your Page ( which can be found when editing the Page, check the URL in the browser ).
    And add the full URL to the image where it says: URL TO YOUR PAGE LOGO

    This article explains adding PHP:

    https://docs.generatepress.com/article/adding-php/

    #1874739
    Rob

    Thanks David – works perfectly!
    https://www.yaronengler.com/home/

    #1874746
    David
    Staff
    Customer Support

    Glad to hear that!

    #2495889
    webyogi

    Hi David,

    I tried the above solution but it is not working for me to change the logo for a particular page.

    Is it because I have Header Layout set as “Use Navigation as Header”?

    Thanks.

    #2495894
    webyogi

    Ok so I tried using the Header Element with the Display Rules set for a specific page and it shows a different logo for that page but I also want a different sticky logo for that page, how do I achieve that? Thanks.

    #2495904
    Leo
    Staff
    Customer Support

    Any chance you can open a new topic and link us to the page in question?

    Thanks!

    #2495914
    webyogi

    Hi Leo,

    Created a new topic – https://generatepress.com/forums/topic/change-header-and-sticky-logo-image-on-one-page/

    Unfortunately I cannot share the link.

    Thanks

    #2496637
    Leo
    Staff
    Customer Support

    Thanks!

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘change logo image on one page’ is closed to new replies.