PHP to show image only on homepage

I am new to PHP, and trying to use it to create an if statement on a wordpress site in order to show a full-width image only on the homepage. I added this code in homepage-template.php, below get_header() and above the rest of the content, but it did not work. Would anyone know if there is a problem with the code, or I just need to find the right place to put it? Thanks

[php]

<?php function storefront_add_image() { ?>
<div id="strip">
    <div class="col-full">
  
    </div>
</div>
<?php

}
add_action( ‘storefront_before_content’, ‘storefront_add_image’ );

?>[/php]

Don’t over complicate it.

Go to the homepage page and add the image. The header, footer, and sidebars can be added to others, but pages are their own page.

Sponsor our Newsletter | Privacy Policy | Terms of Service