header.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /**
  3. * The header for our theme.
  4. *
  5. * This is the template that displays all of the <head> section and everything up until <div id="content">
  6. *
  7. * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
  8. *
  9. * @package Scratchpad
  10. */
  11. ?><!DOCTYPE html>
  12. <html <?php language_attributes(); ?>>
  13. <head>
  14. <meta charset="<?php bloginfo( 'charset' ); ?>">
  15. <meta name="viewport" content="width=device-width, initial-scale=1">
  16. <link rel="profile" href="http://gmpg.org/xfn/11">
  17. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
  18. <?php wp_head(); ?>
  19. </head>
  20. <body <?php body_class(); ?>>
  21. <div id="page" class="site">
  22. <a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'scratchpad' ); ?></a>
  23. <header id="masthead" class="site-header" role="banner">
  24. <nav id="site-navigation" class="main-navigation" role="navigation">
  25. <div class="wrap">
  26. <button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><?php esc_html_e( 'Menu', 'scratchpad' ); ?></button>
  27. <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu' ) ); ?>
  28. </div><!-- .wrap -->
  29. </nav><!-- #site-navigation -->
  30. <div class="site-branding">
  31. <div class="wrap">
  32. <?php
  33. $header_image = get_header_image();
  34. if ( ! empty( $header_image ) ) : ?>
  35. <div class="header-image-contain">
  36. <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
  37. <img src="<?php header_image(); ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="" class="header-image">
  38. </a>
  39. <div class="photo-corners">
  40. <?php
  41. get_template_part( 'images/inline', 'photo-corners.svg' );
  42. get_template_part( 'images/inline', 'photo-corners.svg' );
  43. get_template_part( 'images/inline', 'photo-corners.svg' );
  44. get_template_part( 'images/inline', 'photo-corners.svg' );
  45. ?>
  46. </div><!-- .photo-corners -->
  47. </div><!-- .header-image -->
  48. <?php endif;
  49. scratchpad_the_site_logo();
  50. if ( is_front_page() && is_home() ) : ?>
  51. <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  52. <?php else : ?>
  53. <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
  54. <?php
  55. endif;
  56. $description = get_bloginfo( 'description', 'display' );
  57. if ( $description || is_customize_preview() ) : ?>
  58. <p class="site-description"><?php echo $description; /* WPCS: xss ok. */ ?></p>
  59. <?php endif; ?>
  60. </div><!-- .wrap -->
  61. </div><!-- .site-branding -->
  62. </header><!-- #masthead -->
  63. <div id="content" class="site-content">
  64. <div class="wrap">