• Resolved Francesco

    (@fcolombo)


    Hi guys, I’m wondering what’s the best/smartest way to add a H1 title to the homepage only.

    I thought of 2 options:

    1) wrap the homepage title in <h1>
    or
    2) replace the first <h2> tag with <h1> by editing page-title.php

    <?php if ( is_home() ) : ?>
    		<h2><?php echo alx_blog_title(); ?></h2>

    What would you suggest?

    Cheers.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi!

    The h1 on the homepage sits on the Custom Logo / Site Title, so there should be a H1 there (unless you use full header image).

    Thread Starter Francesco

    (@fcolombo)

    Thank you Alex.
    In fact, I use a header image – but I’m planning on replacing it with a header background and a custom logo.
    Cheers!

    This is what I used to add a H1 (alt) to logo only on homepage:

    <a href="<?php echo home_url(); ?>/">
                        <?php if(is_home() || is_front_page()) { ?>
                        <h1><img src="LINKTOLOGO" alt="YOUR H1 TAG" /></h1>
                        <?php } else { ?>
                                <img src="LINKTOLOGO" alt="YOUR OTHER TAG" />
                        <?php } ?>
                        </a>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Best way to add a H1 tag to the Homepage?’ is closed to new replies.