• 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

Switching single post title h1 with h2

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 › Design Tips and Tricks › Switching single post title h1 with h2

This topic is: resolved
  • This topic has 3 replies, 2 voices, and was last updated 13 years, 1 month ago by David Chu.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • April 2, 2013 at 3:52 pm #32732
    [email protected]
    Member

    Hi All,

    Due to color formatting in a design I'm constructing, I need the post title of single posts to display as <h2> instead of <h1>

    I'm close, with this added to functions.php -

    add_action('genesis_post_title', 'h2_title');
    function h2_title() {
    if ( is_single ( ) ) {
    remove_action('genesis_post_title', 'genesis_do_post_title');
    the_title( '<h2>', '</h2>');
    }
    }

    BUT it's still displaying the original <h1> title in addition to the <h2> title.

    Site is here on lockdown:  http://www.jonathanmerker.com/kind/
    username: guest
    password: WPguest

    Any help appreciated!

    Matt

    April 3, 2013 at 5:49 pm #32954
    David Chu
    Participant

    Rather than removing the title, you can filter it. Check this out, you'll be able to adapt it to what you're doing.

    Still, from an SEO perspective, generally you want that nice juicy H1 tag. Rather than doing the above, I would just style the H1 tag to be like your H2 tag. Cleaner. I have one client who has me playing with title styling constantly. The only tricky thing is to make sure the different types of titles are kept straight, which requires some CSS skills.

    Dave


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

    April 3, 2013 at 5:54 pm #32957
    [email protected]
    Member

    That did the trick!  thank you!

    For anyone referring back to this post, here's how I tweaked it:

     
    /** make single post titles H2 instead of H1 **/

    add_filter( 'genesis_post_title_output', 'ac_post_title_output', 15 );
    function ac_post_title_output( $title ) {
    if ( is_single () )
    $title = sprintf( '<h2 class="entry-title"><span>%s</span></h2>', apply_filters( 'genesis_post_title_text', get_the_title() ) );
    return $title;
    }

    April 3, 2013 at 6:25 pm #32970
    David Chu
    Participant

    Coolness!


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design Tips and Tricks’ 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

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