For some reason, my top header looks different on single pages but is fine on the home page. my site
<?PHP
if ( is_front_page() && is_home() ):
?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">CC AND BUILDS</a> </h1>
<?php
else :
?>
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">CC AND BUILDS</a></p>
<?php
endif;
?>
any ideas?
For some reason, my top header looks different on single pages but is fine on the home page. my site
<?PHP
if ( is_front_page() && is_home() ):
?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">CC AND BUILDS</a> </h1>
<?php
else :
?>
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">CC AND BUILDS</a></p>
<?php
endif;
?>
any ideas?
Share Improve this question asked Dec 12, 2020 at 20:28 LootLoot 112 bronze badges 2- You've made a few mistakes, one of them is hardcoding the logo URL, but making it a relative URL not an absolute URL, as well as making the HTML tags different, if you want them to look the same you should make them be the same – Tom J Nowell ♦ Commented Dec 12, 2020 at 20:58
- can you give me an example, please – Loot Commented Dec 12, 2020 at 21:02
1 Answer
Reset to default 0In the code snippet you posted, it appears that your site's title will be wrapped in an <h1>
tag on the home page (that's what the if ( is_front_page() && is_home() )
code is checking for), and in a <p>
tag in all other cases (eg, a single blog post's view).