Created
February 11, 2022 19:35
-
-
Save chancecorbeil/5d1fb872c4b395bbc87c5311dfd7b58f to your computer and use it in GitHub Desktop.
Use a png as the h1 on the home page using the alt attribute. Remove heading tag on any pagethat is not the home page. For WordPress websites.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Logo --> | |
<?php | |
if (is_front_page()) { | |
echo '<h1 class="site-logo"><a href="' . esc_url( home_url( '/' ) ) . '"><img src="' . get_stylesheet_directory_uri() . '/images/logo/logo.png" | |
alt="The H1 Heading and Logo" /> | |
</a></h1>'; | |
} else { | |
echo '<a href="' . esc_url( home_url( '/' ) ) . '" class="site-logo"><img src="' . get_stylesheet_directory_uri() . '/images/logo/logo.png" | |
alt="The Logo" /> | |
</a>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment