• 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

Using h2 instead of h1 for post titles in Genesis Grid loop

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 › Using h2 instead of h1 for post titles in Genesis Grid loop

This topic is: not resolved
  • This topic has 1 reply, 2 voices, and was last updated 8 years, 5 months ago by JanHoek.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • August 10, 2014 at 6:13 am #118036
    marcello.vicidomini
    Member

    Hi all,

    is there a way to use h2 tags instead of h1 for post titles in the Genesis Grid loop, while keeping the HTML5 support? I mean having:

    
    <header class="entry-header">
         <h2 class="entry-title" itemprop="headline">
              <a href="…" title="…" rel="bookmark">Post title</a>
         </h2> 
    </header>
    

    instead of

    
    <header class="entry-header">
         <h1 class="entry-title" itemprop="headline">
              <a href="…" title="…" rel="bookmark">Post title</a>
         </h1> 
    </header>
    

    Thanks everybody for your help!

    August 16, 2014 at 2:02 pm #119241
    JanHoek
    Participant

    You can try this in your functions.php

    add_filter( 'genesis_post_title_output', 'jan_post_title_output', 10 );
     
    function jan_post_title_output( $title ) {
     
    	if ( is_home () || is_category() || is_singular () || is_archive () )
    		$title = sprintf( '<h2 class="entry-title" itemprop="headline">%s</h2>', apply_filters( 'genesis_post_title_text', get_the_title() ) );
    		$title = sprintf( '<a href="%s" rel="bookmark">%s</a>', get_permalink(), $title );
     
    	return $title;
    }

    Hi, my name is Jan Hoek. Sure, they all say I have a big head, but I like to think it’s way too small for all my ideas.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 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