diff --git a/header.php b/header.php index f19f527..a6dcb6e 100644 --- a/header.php +++ b/header.php @@ -21,7 +21,7 @@ $container = get_theme_mod( 'understrap_container_type' ); -> + >
diff --git a/inc/template-tags.php b/inc/template-tags.php index 2beb880..43700a4 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -45,7 +45,6 @@ if ( ! function_exists( 'understrap_posted_on' ) ) { } } - /** * Prints HTML with meta information for the categories, tags and comments. */ @@ -83,7 +82,6 @@ if ( ! function_exists( 'understrap_entry_footer' ) ) { } } - /** * Returns true if a blog has more than 1 category. * @@ -113,7 +111,6 @@ if ( ! function_exists( 'understrap_categorized_blog' ) ) { } } - /** * Flush out the transients used in understrap_categorized_blog. */ @@ -129,3 +126,29 @@ if ( ! function_exists( 'understrap_category_transient_flusher' ) ) { delete_transient( 'understrap_categories' ); } } + +if ( ! function_exists( 'understrap_body_attributes' ) ) { + /** + * Displays the attributes for the body element. + */ + function understrap_body_attributes() { + /** + * Filters the body attributes. + * + * @param array $atts An associative array of attributes. + */ + $atts = array_unique( apply_filters( 'understrap_body_attributes', $atts = array() ) ); + if ( ! is_array( $atts ) || empty( $atts ) ) { + return; + } + $attributes = ''; + foreach ( $atts as $name => $value ) { + if ( $value ) { + $attributes .= sanitize_key( $name ) . '="' . esc_attr( $value ) . '" '; + } else { + $attributes .= sanitize_key( $name ) . ' '; + } + } + echo trim( $attributes ); // phpcs:ignore WordPress.Security.EscapeOutput + } +}