header.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * The Rebalance header
  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 Rebalance
  10. */
  11. ?><!DOCTYPE html>
  12. <html class="no-js" <?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', 'rebalance' ); ?></a>
  23. <header id="masthead" class="site-header" role="banner">
  24. <div class="col-width header-wrap">
  25. <?php $header_image = get_header_image();
  26. if ( ! empty( $header_image ) ) { ?>
  27. <a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="site-header-image-link" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
  28. <img src="<?php header_image(); ?>" class="site-header-image" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="" />
  29. </a>
  30. <?php } ?>
  31. <div class="site-heading">
  32. <div class="site-branding">
  33. <?php rebalance_site_logo(); ?>
  34. <?php if ( is_front_page() && is_home() ) : ?>
  35. <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  36. <?php else : ?>
  37. <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
  38. <?php endif; ?>
  39. </div><!-- .site-branding -->
  40. <?php if ( has_nav_menu( 'social' ) ) : ?>
  41. <nav class="social-navigation" role="navigation">
  42. <?php wp_nav_menu( array(
  43. 'theme_location' => 'social',
  44. 'depth' => 1,
  45. 'container_class' => 'social-menu-wrap',
  46. 'menu_class' => 'social-menu',
  47. 'link_before' => '<span>',
  48. 'link_after' => '</span>'
  49. ) ); ?>
  50. </nav><!-- #social-navigation -->
  51. <?php endif; ?>
  52. </div><!-- .site-heading -->
  53. </div>
  54. <div class="col-width sub-header-wrap">
  55. <?php $description = get_bloginfo( 'description', 'display' );
  56. if ( $description || is_customize_preview() ) : ?>
  57. <p class="site-description"><?php echo $description; /* WPCS: xss ok. */ ?></p>
  58. <?php endif; ?>
  59. <?php if ( has_nav_menu( 'header' ) ) : ?>
  60. <nav id="site-navigation" class="main-navigation" role="navigation">
  61. <button class="menu-toggle" aria-controls="header-menu" aria-expanded="false" data-close-text="<?php esc_attr_e( 'Close', 'rebalance' ); ?>"><?php esc_html_e( 'Menu', 'rebalance' ); ?></button>
  62. <?php wp_nav_menu( array(
  63. 'theme_location' => 'header',
  64. 'menu_id' => 'header-menu'
  65. ) ); ?>
  66. </nav><!-- #site-navigation -->
  67. <?php endif; ?>
  68. </div><!-- .col-width -->
  69. </header><!-- #masthead -->
  70. <div id="content" class="site-content clear">
  71. <div class="col-width">