Site logo

Archived topic

change logo image on one page

8 replies · Started by Rob on July 28, 2021

Viewing posts 1–9 of 9

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/

Glad to hear that!

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.

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.

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

Thanks!

Thanks!

This archived topic is closed to new replies.