Created
February 11, 2022 19:51
-
-
Save chancecorbeil/769195c43ebe6cc8362ad11378993a96 to your computer and use it in GitHub Desktop.
Use a svg as the h1 on the home page using screen reader only text inside the link tag. Remove heading tag on any page that 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 (SVG) --> | |
<?php | |
if (is_front_page()) { | |
echo '<h1 class="site-logo"><a href="' . esc_url( home_url( '/' ) ) . '">'; | |
get_template_part('images/logo/logo-base-theme.svg'); | |
echo '<span class="is-sr-only">The h1 and logo</span></a></h1>'; | |
} else { | |
echo '<a href="' . esc_url( home_url( '/' ) ) . '" class="site-logo">'; | |
get_template_part('images/logo/logo-base-theme.svg'); | |
echo '<span class="is-sr-only">The logo</span></a>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment