This repository has been archived on 2020-05-08. You can view files and clone it, but cannot push or open issues or pull requests.
understrap/header.php

83 lines
2.8 KiB
PHP
Raw Permalink Normal View History

2014-12-10 11:36:38 +00:00
<?php
/**
* The header for our theme.
*
* Displays all of the <head> section and everything up till <div id="content">
*
* @package understrap
*/
2016-11-21 18:47:05 +00:00
$container = get_theme_mod( 'understrap_container_type' );
?>
<!DOCTYPE html>
2014-12-10 11:36:38 +00:00
<html <?php language_attributes(); ?>>
<head>
2016-11-21 18:47:05 +00:00
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
2016-11-21 18:47:05 +00:00
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
2017-01-06 19:09:14 +00:00
<meta name="apple-mobile-web-app-title" content="<?php bloginfo( 'name' ); ?> - <?php bloginfo( 'description' ); ?>">
2016-11-21 18:47:05 +00:00
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
2014-12-10 11:36:38 +00:00
</head>
<body <?php body_class(); ?>>
2014-12-19 09:04:55 +00:00
2016-11-21 18:47:05 +00:00
<div class="hfeed site" id="page">
2016-11-21 18:47:05 +00:00
<!-- ******************* The Navbar Area ******************* -->
<div class="wrapper-fluid wrapper-navbar" id="wrapper-navbar">
2014-12-10 11:36:38 +00:00
2017-01-27 07:15:34 +00:00
<a class="skip-link screen-reader-text sr-only" href="#content"><?php esc_html_e( 'Skip to content',
2016-11-21 18:47:05 +00:00
'understrap' ); ?></a>
2015-08-12 15:21:46 +00:00
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
2014-12-10 11:36:38 +00:00
2017-01-19 10:29:07 +00:00
<?php if ( 'container' == $container ) : ?>
<div class="container">
<?php endif; ?>
2017-01-06 19:30:34 +00:00
2016-11-21 18:47:05 +00:00
<!-- Your site title as branding in the menu -->
<?php if ( ! has_custom_logo() ) { ?>
<?php if ( is_front_page() && is_home() ) : ?>
<h1 class="navbar-brand mb-0"><a rel="home" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<?php else : ?>
<a class="navbar-brand" rel="home" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"><?php bloginfo( 'name' ); ?></a>
<?php endif; ?>
2017-01-06 19:09:14 +00:00
2016-11-21 18:47:05 +00:00
<?php } else {
the_custom_logo();
2017-01-06 19:09:14 +00:00
} ?><!-- end custom logo -->
2014-12-19 09:04:55 +00:00
2017-08-18 07:52:07 +00:00
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
2016-11-21 18:47:05 +00:00
<!-- The WordPress Menu goes here -->
<?php wp_nav_menu(
array(
'theme_location' => 'primary',
2017-01-06 18:51:53 +00:00
'container_class' => 'collapse navbar-collapse',
2017-01-06 19:09:14 +00:00
'container_id' => 'navbarNavDropdown',
'menu_class' => 'navbar-nav',
2016-11-21 18:47:05 +00:00
'fallback_cb' => '',
'menu_id' => 'main-menu',
'walker' => new WP_Bootstrap_Navwalker(),
)
); ?>
2017-01-19 10:29:07 +00:00
<?php if ( 'container' == $container ) : ?>
2017-01-06 19:30:34 +00:00
</div><!-- .container -->
2017-01-19 10:29:07 +00:00
<?php endif; ?>
2014-12-19 09:04:55 +00:00
2016-11-21 18:47:05 +00:00
</nav><!-- .site-navigation -->
2014-12-19 09:04:55 +00:00
2017-01-27 07:15:34 +00:00
</div><!-- .wrapper-navbar end -->