• socialclub

    (@socialclub)


    How i change the size of page title in homepage the H2 to H1?

    <div class="page-title pad group">
    
    			<h2>Bora Nessa</h2>
    
    </div>
Viewing 6 replies - 1 through 6 (of 6 total)
  • mrtom414

    (@mrtom414)

    you would have to create a child theme and include the header.php file and change the header in the file.

    bdbrown

    (@bdbrown)

    The page title is set in page-title.php. As @mrtom414 stated you need to be running a child theme as you’ll need to modify one theme file. If you don’t have a child theme you can download one from the theme web site. Then copy /inc/page-title.php from the parent theme to the same directory in your child theme. At the top of the file you’ll find this:

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

    Change the <h2> tags to <h1>.

    The only thing I would add is that this will give you two <h1> tags on the home page since the site title is also an <h1> tag. I’m not a SEO expert but I think best practices include having only one <h1> tag on a page.

    Thread Starter socialclub

    (@socialclub)

    Hello bdbrown ,

    In all sites researching to improve SEO point out that the homepage does not have title H1 , so I’m thinking of making this change.

    bdbrown

    (@bdbrown)

    Up to you. I just thought I’d mention it.

    Thread Starter socialclub

    (@socialclub)

    Hi bdbrown,

    Where can I find this title H1 available?

    bdbrown

    (@bdbrown)

    In the theme functions.php file, function alx_site_title():

    if ( is_front_page() || is_home() ) {
    	$sitename = '<h1 class="site-title">'.$link.'</h1>'."\n";
    } else {
    	$sitename = '<p class="site-title">'.$link.'</p>'."\n";
    }
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘H1 in Homepage’ is closed to new replies.