In the eStore theme by Elegant Themes we recently wanted to use a different logo on the front page than we did for every other page on a website. It was simple enough to create a child theme and then make our custom header.php. If you aren’t familiar with child themeing start here. If you are, continue on!

Start by making sure that you have defined your logo in the them options page:

Elegant Themes Control Panel

Under Appearance, Theme Options

Then, once you have created and switched to your child theme, copy the header.php from your original theme’s folder to your new child theme’s folder and edit the file. You can either edit it through WordPress, or by using a command line or Graphical Interface editor on your server. If you aren’t sure how to do that, contact your webhost and they can help you with the specifics.

In the newly created childtheme’s header.php you just need to find this code (which grabs the logo that’s defined in the theme’s options panel):

<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php $logo = (get_option('estore_logo') <> '') ? get_option('estore_logo') : get_template_directory_uri().'/images/logo.png'; ?>
<img src="<?php echo esc_attr( $logo ); ?>" alt="<?php echo esc_attr(get_bloginfo('name')); ?>" id="logo"/></a>

And you will replace that entire line of code with this code, making sure to update the HOMEPAGELOGO with the logo you want to display on on the homepage:

<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php $logo = "HOMEPAGELOGO"; ?>
<?php } else { ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php $logo = (get_option('estore_logo') <> '') ? get_option('estore_logo') : get_template_directory_uri().'/images/logo.png'; ?>
<?php } ?><!--end replaced code -->

If you’ve done it correctly, then your homepage will display the static image that you defined in your new code as its logo, and the rest of your pages will show the logo that you defined in the ePanel!

Good luck and happy WordPressing

 

Source