Support » Fixing WordPress » Help set H1 tag on Website TITLE on the Homepage

  • Resolved deewinc

    (@deewinc)


    Hello guys,

    I bought a theme a few weeks ago and realized that the developer had stripped down some default Customization features of WordPress. Besides, I noticed that functions that might have a huge impact on SEO are messed up.

    For example, the developer has set the website’s logo with a H1 tag. Also, post and page tiles were set with H2 tags by giving preference to the logo with a H1 tag.

    Unfortunately, the developer has removed the customization parts in WordPress that would let me replace areas with H2 tags with H1 tags.

    I had to do the tedious work of manually editing theme. I managed to wrap the logo in a div tag and fixed the areas with H2 tags that require H1 tags.

    However, the biggest challenge has been locating the <title>NAME OF WEBSITE</title> (as set in WordPress under Settings>>>General) on the homepage to wrap it up with a H1 tag.

    I have checked the header.php file but it’s not there. Any ideas on where I can find it?

    Unfortunately, the developer has refused to fix the issues citing that he has so many commitments and other people have used the theme with no problems yet the issue here is about SEO.

    • This topic was modified 3 weeks, 5 days ago by deewinc.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Hello. I hope I understood your concern because I don’t speak English. Then, to change the tag in the theme title, you should search for this function get_bloginfo('name') in the header.php. If it’s not in the head.php, then you can be in another php file somewhere on the theme.

    Joy

    (@joyously)

    If you truly are talking about <title>, the theme doesn’t handle it. WordPress does. That is the part that is shown as the title of the browser window, and if you change it to <h1> it is invalid HTML.

    If what you meant to say was the heading used for the blog title at the top of your page, that is usually in the header.php template file.
    Most themes use a <p> for the site title when not on the home page, and a <h1> on the home page.

    @marcio-zebedeu – I have managed to find it, it under this div tag. Any idea of how to set up the H1 tag on the SITE TITLE?

    <strong><div class="logo" style="background: url(<?php echo $logo_url; ?>);"><a>"><?php bloginfo('name'); ?></a></div></strong>

    @joyously ~ I want to enable the H1 tag on the home page. I can see on WordPress, the H1 tag is pinged the site’s name. Any idea?

    • This reply was modified 3 weeks, 4 days ago by deewinc.
    Joy

    (@joyously)

    Well, no, because we can’t see the source code of your theme or your site.
    You are pretty much on your own.

    @marcio-zebedeu ~ thanks man. I have successfully managed to implement it by writing this code around the <?php bloginfo(‘name’) line

    <div class="logo" style="background: url(<?php echo $logo_url; ?>);"><h1 class="site-title"><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1></div>

    Thank you so much guys

    • This reply was modified 3 weeks, 4 days ago by deewinc.

    @deewinc try something like this:

    <div class="logo" style="background: url(<?php echo $logo_url; ?>);">
    <?php if ( is_front_page() && is_home() ) : ?>
    
    			<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
    		<?php else : ?>
    			<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
    		<?php endif; ?>
    </div>

    @marcio-zebedeu
    Let me also try that one and see. Before then. What do you think of my integration?

    You’re welcome. I’m glad it worked out.

    I had to play around with the integration because placing the <h1 class="site-title"> before <a href="<?php bloginfo('url'); ?> makes the logo not to redirect back to the homepage.

    Here is what I mean. When you click on a Website’s logo or logo name, it’s supposed to redirect you back to the homepage. In this case, when I use the integration as explained in the beginning of this comment, clicking the logo does not redirect you to the homepage.

    So, I have placed the opening of the H1 tag <h1 class="site-title"> before <?php bloginfo('name'); ?>

    Therefore, the final code is the following and the logo redirects back to the homepage when clicked.

    <div class="logo" style="background: url(<?php echo $logo_url; ?>);"><a href="<?php bloginfo('url'); ?>"><h1 class="site-title"><?php bloginfo('name'); ?></a></h1></div>

    Thank you once more @marcio-zebedeu . This would haven’t been possible without you.

    • This reply was modified 3 weeks, 4 days ago by deewinc.

    It’s always good to be able to help 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.