header.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 Button 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', 'button-2' ); ?></a>
  20. <header id="masthead" class="site-header" role="banner">
  21. <div class="site-branding">
  22. <?php the_custom_logo(); ?>
  23. <?php
  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><!-- .site-branding -->
  36. </header><!-- #masthead -->
  37. <nav id="site-navigation" class="main-navigation" role="navigation">
  38. <button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false">
  39. <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>
  40. <?php esc_html_e( 'Menu', 'button-2' ); ?>
  41. </button>
  42. <?php wp_nav_menu( array( 'theme_location' => 'menu-1', 'menu_id' => 'primary-menu' ) ); ?>
  43. <?php
  44. if ( function_exists( 'button_2_woocommerce_header_cart' ) ) {
  45. button_2_woocommerce_header_cart();
  46. }
  47. ?>
  48. </nav><!-- #site-navigation -->
  49. <?php if ( get_header_image() ) : ?>
  50. <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
  51. <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">
  52. </a>
  53. <?php endif; // End header image check. ?>
  54. <div id="content" class="site-content">