Skip to content

Instantly share code, notes, and snippets.

@nickcernis

nickcernis/functions.php

Last active Jan 20, 2020
Embed
What would you like to do?
Set Genesis static homepage site title and entry title heading levels to h1 and h2
<?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
You can’t perform that action at this time.