How to get H1 on my home page when only showing recent posts.(xtheme/ethos)

Using X theme with Ethos.

My homepage is set to only show recent posts. It has no H1 tags.

I used the code here https://theme.co/apex/forums/topic/remove-h1-from-logo-have-searched-the-forums/ to remove the h1s from my logo as it was giving me duplicate h1s on all pages. Everything is working fine except my home page has no h1s now.

Do not want to create a page for my home page, want to leave it a just showing recent posts. Where can I manually add an H1?

Hello @bigboogie,

Thanks for asking. :slight_smile:

Please note that the customisation you are looking for will require changes in theme files which falls outside the scope of support we can offer. However to help you get started I can point you in right direction.

First, as this will require changes in theme files I suggest you to setup child theme. You can use following resources to download and setup child theme.

Download Child theme from following source: https://theme.co/apex/child-themes

Please take a look at following article to setup child theme:

After that you can copy _index.php from /wp-content/themes/x/framework/views/ethos/ and paste under /wp-content/themes/x-child/framework/views/ethos/. Please note that you need to create the child folders in the same order. Next you can add the headings manually after line number 12.

To learn more about HTML heading tags, please take a look at following resources.

Heading Tag: https://www.w3schools.com/htmL/html_headings.asp

You can also take a look at following videos on YouTube by Matt Cutts on Heading and SEO:

Thanks.

Already have my child setup. Added the code. viewed source on home page. Still no H1s.

Hi Shaun,

Hope you’re having a good day, you removed the <h1 class="visually-hidden"> by following the guide provided on the old thread you linked right? Please put it back.

Let’s wrap it with <?php if(is_home()): ?> condition so it only shows up on the blog page.

<?php if(is_home()): ?>
    <?php echo '<h1 class="visually-hidden">' . $site_name . '</h1>'; ?>
<?php endif; ?>

More info about is_home() here.

Hope it helps,
Cheers!

Working like a charm. Thanks!

Upon viewing my source code. It looks like my title and description for the home page are the same. Anyway to edit these manually? They should be 2 completely different things. Both are being pulled from the same field Settings>>General>>Tagline

Hi @bigboogie

You can do that with aid of a plugin called “WordPress SEO by Yoast”, following this guide:

Thanks.

Ok I see yoast has homepage options in the settings directly. Done and Done. Thanks again for all the help!

You are most welcome. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.