header.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 Radcliffe 2
  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. <?php wp_head(); ?>
  18. </head>
  19. <body <?php body_class(); ?>>
  20. <div id="page" class="site">
  21. <a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'radcliffe-2' ); ?></a>
  22. <header id="masthead" class="site-header">
  23. <?php radcliffe_2_contact_info( 'header' ); ?>
  24. <?php if ( get_header_image() ) : ?>
  25. <div class="header-image">
  26. <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
  27. <img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
  28. </a>
  29. </div><!-- #header-image -->
  30. <?php endif; ?>
  31. <div class="header-wrapper">
  32. <div class="site-branding">
  33. <?php the_custom_logo(); ?>
  34. <div class="site-branding-text">
  35. <?php
  36. if ( is_front_page() && is_home() ) : ?>
  37. <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  38. <?php else : ?>
  39. <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
  40. <?php
  41. endif;
  42. $description = get_bloginfo( 'description', 'display' );
  43. if ( $description || is_customize_preview() ) : ?>
  44. <p class="site-description"><?php echo $description; /* WPCS: xss ok. */ ?></p>
  45. <?php
  46. endif; ?>
  47. </div><!-- .site-branding-text -->
  48. </div><!-- .site-branding -->
  49. </div><!-- .header-wrapper -->
  50. <div class="menu-wrapper">
  51. <?php if ( has_nav_menu( 'menu-1' ) ) : ?>
  52. <nav id="site-navigation" class="main-navigation">
  53. <button class="menu-toggle" aria-controls="header-menu" aria-expanded="false">
  54. <?php
  55. echo radcliffe_2_get_svg( array( 'icon' => 'menu' ) );
  56. echo radcliffe_2_get_svg( array( 'icon' => 'close' ) );
  57. esc_html_e( 'Menu', 'radcliffe-2' );
  58. ?>
  59. </button>
  60. <?php
  61. wp_nav_menu( array(
  62. 'theme_location' => 'menu-1',
  63. 'menu_id' => 'header-menu',
  64. ) );
  65. ?>
  66. </nav><!-- #site-navigation -->
  67. <?php endif; ?>
  68. <?php // Add Woocommerce Cart to header if Woocommerce exists
  69. if ( class_exists( 'WooCommerce' ) ) {
  70. radcliffe_2_woocommerce_header_cart();
  71. } ?>
  72. <?php radcliffe_2_social_menu(); ?>
  73. </div><!-- .menu-wrapper -->
  74. </header><!-- #masthead -->
  75. <?php radcliffe_2_hero_area(); ?>
  76. <div id="content" class="site-content">