header.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * The Header for our theme.
  4. *
  5. * Displays all of the <head> section and everything up till <div id="content">
  6. *
  7. * @package Penscratch 2
  8. */
  9. ?><!DOCTYPE html>
  10. <html <?php language_attributes(); ?>>
  11. <head>
  12. <meta charset="<?php bloginfo( 'charset' ); ?>">
  13. <meta name="viewport" content="width=device-width, initial-scale=1">
  14. <link rel="profile" href="http://gmpg.org/xfn/11">
  15. <?php wp_head(); ?>
  16. </head>
  17. <body <?php body_class(); ?>>
  18. <div id="page" class="hfeed site">
  19. <a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'penscratch-2' ); ?></a>
  20. <header id="masthead" class="site-header" role="banner">
  21. <div class="site-branding">
  22. <?php
  23. the_custom_logo();
  24. if ( is_front_page() && is_home() ) : ?>
  25. <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  26. <?php else : ?>
  27. <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
  28. <?php
  29. endif;
  30. $description = get_bloginfo( 'description', 'display' );
  31. if ( $description || is_customize_preview() ) : ?>
  32. <p class="site-description"><?php echo $description; /* WPCS: xss ok. */ ?></p>
  33. <?php
  34. endif; ?>
  35. </div>
  36. <nav id="site-navigation" class="main-navigation" role="navigation">
  37. <button class="menu-toggle">
  38. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><rect x="0" fill="none" width="16" height="16"/><g><path id="menu-icon" d="M0 14h16v-2H0v2zM0 2v2h16V2H0zm0 7h16V7H0v2z"/></g></svg>
  39. <?php esc_html_e( 'Menu', 'penscratch-2' ); ?>
  40. </button>
  41. <?php wp_nav_menu( array( 'theme_location' => 'menu-1' ) ); ?>
  42. </nav><!-- #site-navigation -->
  43. </header><!-- #masthead -->
  44. <div id="content" class="site-content">
  45. <?php if ( get_header_image() ) : ?>
  46. <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
  47. <img class="custom-header" src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="">
  48. </a>
  49. <?php endif; // End header image check. ?>