Skip to content

Instantly share code, notes, and snippets.

@chancecorbeil
Created June 27, 2015 23:48
Show Gist options
  • Save chancecorbeil/079099dbcc423a677503 to your computer and use it in GitHub Desktop.
Save chancecorbeil/079099dbcc423a677503 to your computer and use it in GitHub Desktop.
Alternating h1 and h2 title tags, depending if page is home page or not
<?php if(is_front_page()) : ?>
<!-- This is a homepage -->
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<?php endif; ?>
<?php if(!is_front_page()) : ?>
<!-- This is not a homepage -->
<h2 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h2>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment