Topic: Logo question -- one version on home page; another version on others

I want to use two slightly different versions of my logo.

Version 1 -- just on home page
Version 2 -- on all other pages

What's the easiest way to do that?

Thanks for such a great theme!

Re: Logo question -- one version on home page; another version on others

Logo is actually "custom header" image, once uploaded it will show the same on all pages. Now what you can do is this:

Copy header.php to your Child Theme and go with e.g.

<?php
if ( is_home() ) {
    // This is a homepage
} else {
    // This is not a homepage
}
?>

Thanks,
Emil

jay wrote:

I want to use two slightly different versions of my logo.

Version 1 -- just on home page
Version 2 -- on all other pages

What's the easiest way to do that?

Thanks for such a great theme!

Re: Logo question -- one version on home page; another version on others

Emil,

this is exactly what I want to do, but I don't know much about writing php. Can you walk me through how to use this in my file?
For example:
Where to put it in the code?
How do I point the file to my alternate logo image?

thanks for your help!

Re: Logo question -- one version on home page; another version on others

This can be done in header.php in Child Theme form, now, please note that in the order to do this, you won't be able to use "Custom Header" as your logo, everything would need to be hardcoded:

So in Child Theme's header.php locate the logo and replace with:

    <?php if ( get_header_image() != '' ) : ?>
               
        <div id="logo">
        
            <?php if ( is_home() ) :?>
                
                <a href="<?php echo home_url('/'); ?>"><img src="http://example.com/images/logo1.png" width="300" height="100" /></a>
            
            <?php else: ?>
                
                <a href="<?php echo home_url('/'); ?>"><img src="http://example.com/images/logo2.png" width="300" height="100" /></a>
           
           <?php endif; ?>
           
        </div><!-- end of #logo -->
        
    <?php endif; // header image was removed ?>

That should work,
Emil

fox.and.fish wrote:

Emil,

this is exactly what I want to do, but I don't know much about writing php. Can you walk me through how to use this in my file?
For example:
Where to put it in the code?
How do I point the file to my alternate logo image?

thanks for your help!

Re: Logo question -- one version on home page; another version on others

Thanks Emil, I got it.

Re: Logo question -- one version on home page; another version on others

no problem smile

Emil

fox.and.fish wrote:

Thanks Emil, I got it.