• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Petersen Media Group

Petersen Media Group

We help you spend less time ensuring your site is there, and more time making it profitable.

  • Home
  • About Us
  • FAQs
    • WordPress Hosting
    • Hosting Services
  • Benefits
  • Services
    • Choose your plan

Change Genesis .site-title H1 Wrap on the Homepage

January 13, 2017 by

I got an interesting request this week to change his Genesis framework child theme’s homepage .site-title H1 wrap to a p wrap. I was going to advise against this until the request continued to change one of the widget titles to an H1 and become his new site’s title.

My first thought was that I had to edit the entire header or site title with a filter but it was actually much more simple than that.

Looking at the Genesis core code, it starts off looking like something familiar: adding a filter for genesis_seo_title. Then I saw something else by jumping around a bit in that area of lib/structure/header.php:

// And finally, $wrap in h1 if HTML5 & semantic headings enabled.
$wrap = genesis_html5() && genesis_get_seo_option( 'semantic_headings' ) ? 'h1' : $wrap;
$wrap = apply_filters( 'genesis_site_title_wrap', $wrap );

Aha! Could it really be as simple as changing that heading in the wrap? As we read on in the file, we see more evidence that is how things work:

// Determine which wrapping tags to use.
$wrap = genesis_is_root_page() && 'description' === genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'p';

// Wrap homepage site description in p tags if static front page.
$wrap = is_front_page() && ! is_home() ? 'p' : $wrap;

// And finally, $wrap in h2 if HTML5 & semantic headings enabled.
$wrap = genesis_html5() && genesis_get_seo_option( 'semantic_headings' ) ? 'h2' : $wrap;

So this is the code to change the site title’s wrap when on the front-page… by placing this in the front-page.php file found in most of the child themes:

//* Change site-title SEO wrap
add_filter('genesis_site_title_wrap','seo_wrap_site_title');

function seo_wrap_site_title($wrap) {
	return 'p';
}

This matches what the title wrap is on inner pages and I won’t dwell on or try to figure out why this child theme’s front-page title wasn’t already how the client wanted, but now you, too, have the code to change the wrap on the site title in Genesis with a very easy filter.

Genesis Framework

Primary Sidebar

Recent Posts

  • Change Genesis .site-title H1 Wrap on the Homepage
  • The Year of 2017 Goals for Petersen Media Group
  • Forever to Finish, Gone in the Blink of an Eye: 2016
  • Add Genesis Custom Post Type Archive Settings
  • Use Minified Stylesheet with Genesis Themes with Front-Page Customizer Backgrounds

Recent Comments

  • Mike Hale on The Year of 2017 Goals for Petersen Media Group
  • Little Shiva on The Year of 2017 Goals for Petersen Media Group
  • Luke Cavanagh on A Response to the WordPress Customizer Expansion: Removal
  • Chris Johnson on Why Partnerships Often Don’t Sail
  • divakara ganesh on Two Things You Need to Do to Your Genesis 2.2 Theme

Archives

  • January 2017
  • August 2016
  • May 2016
  • October 2015
  • September 2015
  • August 2015
  • June 2015
  • April 2015
  • December 2014
  • November 2014
  • October 2014
  • August 2014
  • May 2014
  • April 2014
  • February 2014
  • January 2014
  • November 2013
  • September 2013
  • July 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • January 2000

Categories

  • Business Tips
  • Genesis Framework
  • Investments in You
  • Products
  • Technology
  • Uncategorized
  • WordCamp Slide
  • WordPress Tips

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Footer

Petersen Media Group was founded on the idea that good work, transparent and honest communication, and radical generosity are the keys to success in business and life.

The WordPress community has shown up over and over to prove this to be true.

We look forward to being entrusted with your business.

Navigation

  • Home
  • About Us
  • Blog
  • Choose Your Plan
  • FAQs
  • Contact
  • Disclaimer

This site is independently owned. It is not sponsored by StudioPress, WP Engine, WordPress, or Automattic Inc.

Theme and various assets used with permission from SEOThemes and GenesisSiteCare.

Copyright © 2019 · Petersen Media Group