Last active
August 24, 2022 18:10
-
-
Save nickcernis/eefbdf4a78bccb5364e1e25a9dec64ff to your computer and use it in GitHub Desktop.
Set Genesis static homepage site title and entry title heading levels to h1 and h2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'genesis_entry_title_wrap', 'custom_homepage_title_to_h2' ); | |
/** | |
* Set page title to h2 on a static homepage if Genesis SEO is not in use. | |
* | |
* @param string $wrap The original wrap. | |
* @return string The new wrap. | |
*/ | |
function custom_homepage_title_to_h2( $wrap ) { | |
if ( is_front_page() && ! is_home() && ! genesis_seo_active() ) { | |
return 'h2'; | |
} | |
return $wrap; | |
} | |
add_filter( 'genesis_site_title_wrap', 'custom_homepage_site_title_to_h1' ); | |
/** | |
* Set site title to h1 on a static homepage if Genesis SEO is not in use. | |
* | |
* @param string $wrap The original wrap. | |
* @return string The new wrap. | |
*/ | |
function custom_homepage_site_title_to_h1( $wrap ) { | |
if ( is_front_page() && ! is_home() && ! genesis_seo_active()) { | |
return 'h1'; | |
} | |
return $wrap; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment