- Add wp_head(), body_class() and wp_body_open(). - Drop the hardcoded <title>; title-tag now handles it. - Add a skip link as the first element in <body>. - Wrap the header in <header class="site-header"> and the menu in <nav class="site-nav">. The existing #nav-grid and .header-menu-class hooks are untouched. - Skip the icon <link> and the logo <img> when there is no site icon, and give the logo image an empty alt (the site name text follows it in the same link, so the image is decorative). - Open <main id="main"> after the header. - Keep the viewport meta tag.
46 lines
1.2 KiB
PHP
46 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Site header.
|
|
*
|
|
* @package Super_Simple_WP_Theme
|
|
*/
|
|
|
|
$sswt_site_icon = get_site_icon_url();
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html <?php language_attributes(); ?>>
|
|
<head>
|
|
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<?php if ( $sswt_site_icon ) : ?>
|
|
<link rel="icon" href="<?php echo esc_url( $sswt_site_icon ); ?>">
|
|
<?php endif; ?>
|
|
<?php wp_head(); ?>
|
|
</head>
|
|
<body <?php body_class(); ?>>
|
|
<?php wp_body_open(); ?>
|
|
<a class="skip-link screen-reader-text" href="#main"><?php esc_html_e( 'Hopp til innhald', 'super-simple-wp-theme' ); ?></a>
|
|
<header class="site-header">
|
|
<nav class="site-nav" aria-label="<?php esc_attr_e( 'Hovudmeny', 'super-simple-wp-theme' ); ?>">
|
|
<div id="nav-grid">
|
|
<div class="logo">
|
|
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
|
|
<?php if ( $sswt_site_icon ) : ?>
|
|
<img src="<?php echo esc_url( $sswt_site_icon ); ?>" alt="">
|
|
<?php endif; ?>
|
|
<span><?php bloginfo( 'name' ); ?></span>
|
|
</a>
|
|
</div>
|
|
<?php
|
|
wp_nav_menu(
|
|
array(
|
|
'theme_location' => 'header-menu',
|
|
'container_class' => 'header-menu-class',
|
|
)
|
|
);
|
|
?>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
<main id="main" class="site-main">
|