Move schema markup to body element

Removes schema markup from the div#wrapper-navbar element.
Re-adds the schema markup on the body element via filter.
This commit is contained in:
IanDelMar 2019-12-03 08:19:45 +01:00
parent a2bbdb0eb7
commit 7a63872671
2 changed files with 16 additions and 1 deletions

View File

@ -26,7 +26,7 @@ $container = get_theme_mod( 'understrap_container_type' );
<div class="site" id="page">
<!-- ******************* The Navbar Area ******************* -->
<div id="wrapper-navbar" itemscope itemtype="http://schema.org/WebSite">
<div id="wrapper-navbar">
<a class="skip-link sr-only sr-only-focusable" href="#content"><?php esc_html_e( 'Skip to content', 'understrap' ); ?></a>

View File

@ -133,3 +133,18 @@ if ( ! function_exists( 'understrap_mobile_web_app_meta' ) ) {
}
}
add_action( 'wp_head', 'understrap_mobile_web_app_meta' );
if ( ! function_exists( 'understrap_default_body_attributes' ) ) {
/**
* Adds schema markup to the body element.
*
* @param array $atts An associative array of attributes.
* @return array
*/
function understrap_default_body_attributes( $atts ) {
$atts['itemscope'] = '';
$atts['itemtype'] = 'http://schema.org/WebSite';
return $atts;
}
}
add_filter( 'understrap_body_attributes', 'understrap_default_body_attributes' );