Site title H1 to H2 only for main page and the rest to use h4 and h5.

Hi. Just have to begin thanking you for a great theme.

I´m not very skilled when it comes to php coding. But I am looking for a way to set site title as H1 and description as H2 on main page (Post page) and when people visit a page or a post the site title and description changes to h4/h5 or something, and the post/page title are h1 and sub h2. I found a tip online and about using this code, I think you can fill inn the blanks :wink:

<?php if(is_home()) : ?> 

code here about h1/h2

<?php else : ?>

code here about h4/h5

<?php endif; ?>

Can you verify that this is a good, stable and safe way to do this with your theme? Or is it a better way to do this?

Thank you for your feedback! I really appreciate it!

Inside header-extensions.php file that you can find in travelify folder >> library >> structure find this code snippet:

<h1 id="site-title">
	<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
		<?php bloginfo( 'name' ); ?>
	</a>
</h1>
<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>

And replace it with something like this:

<?php if(is_home()) : ?>

<h1 id="site-title">
	<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
		<?php bloginfo( 'name' ); ?>
	</a>
</h1>
<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>

<?php else : ?>

<h4 id="site-title">
	<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
		<?php bloginfo( 'name' ); ?>
	</a>
</h4>
<h5 id="site-description"><?php bloginfo( 'description' ); ?></h5>

<?php endif; ?>

This code uses conditional tags that are part of WordPress and are perfectly safe to use for Travelify theme.

Nice! Thank you very much for your reply. I will definitely use this :slight_smile: