• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

missing h1 tag in homepage genesis sample theme

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › missing h1 tag in homepage genesis sample theme

This topic is: resolved

Tagged: genesis sample, h1, homepage

  • This topic has 4 replies, 3 voices, and was last updated 3 years ago by sevenweb.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • July 31, 2019 at 5:52 am #492687
    sevenweb
    Participant

    I'm using the genesis-sample theme with the yoast plug-in enabled and I set up a static page as the home page.
    I have a problem with the missing h1 tag on the home page. why isn't the h1 tag?

    July 31, 2019 at 7:27 am #492688
    tubidy
    Member

    Using H1 on the home page means nothing to me. Of course, expert friends can answer better.

    August 1, 2019 at 1:51 pm #492727
    sevenweb
    Participant

    I try to explain my problem better.
    The h1 tag is absent on the homepage and I do not understand how to insert it.

    the website is:

    Centro Medico Spazio Benessere

    August 1, 2019 at 5:39 pm #492730
    Victor Font
    Moderator

    Look in functions.php for this code:

    add_filter( 'genesis_seo_title', 'genesis_sample_header_title', 10, 3 );
    /**
     * Removes the link from the hidden site title if a custom logo is in use.
     *
     * Without this filter, the site title is hidden with CSS when a custom logo
     * is in use, but the link it contains is still accessible by keyboard.
     *
     * @since 1.2.0
     *
     * @param string $title  The full title.
     * @param string $inside The content inside the title element.
     * @param string $wrap   The wrapping element name, such as h1.
     * @return string The site title with anchor removed if a custom logo is active.
     */
    function genesis_sample_header_title( $title, $inside, $wrap ) {
    
    	if ( has_custom_logo() ) {
    		$inside = get_bloginfo( 'name' );
    	}
    
    	return sprintf( '<%1$s class="site-title">%2$s</%1$s>', $wrap, $inside );
    
    }

    You're using a custom logo so you have to add you're own h1 tag on the home page. Modify the code to read:

    add_filter( 'genesis_seo_title', 'genesis_sample_header_title', 10, 3 );
    /**
     * Removes the link from the hidden site title if a custom logo is in use.
     *
     * Without this filter, the site title is hidden with CSS when a custom logo
     * is in use, but the link it contains is still accessible by keyboard.
     *
     * @since 1.2.0
     *
     * @param string $title  The full title.
     * @param string $inside The content inside the title element.
     * @param string $wrap   The wrapping element name, such as h1.
     * @return string The site title with anchor removed if a custom logo is active.
     */
    function genesis_sample_header_title( $title, $inside, $wrap ) {
    
    	if ( has_custom_logo() ) {
    		$inside = get_bloginfo( 'name' );
    	}
    	
    	if ( is_home() || is_front_page() ) {
    		$wrap = "h1";
    	}
    
    	return sprintf( '<%1$s class="site-title">%2$s</%1$s>', $wrap, $inside );
    
    }

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    August 2, 2019 at 3:14 pm #492755
    sevenweb
    Participant

    Ok perfect tanks 😉

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘missing h1 tag in homepage genesis sample theme’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2022 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble