header.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 Canard
  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. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
  16. <?php wp_head(); ?>
  17. </head>
  18. <body <?php body_class(); ?>>
  19. <div id="page" class="hfeed site">
  20. <a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'canard' ); ?></a>
  21. <header id="masthead" class="site-header" role="banner">
  22. <?php if ( has_nav_menu( 'secondary' ) || has_nav_menu( 'social' ) ) : ?>
  23. <div class="site-top">
  24. <div class="site-top-inner">
  25. <?php if ( has_nav_menu( 'secondary' ) ) : ?>
  26. <nav class="secondary-navigation" role="navigation">
  27. <?php
  28. wp_nav_menu( array(
  29. 'theme_location' => 'secondary',
  30. 'depth' => 1,
  31. ) );
  32. ?>
  33. </nav><!-- .secondary-navigation -->
  34. <?php endif; ?>
  35. <?php if ( has_nav_menu( 'social' ) ) : ?>
  36. <nav class="social-navigation" role="navigation">
  37. <?php
  38. wp_nav_menu( array(
  39. 'theme_location' => 'social',
  40. 'link_before' => '<span class="screen-reader-text">',
  41. 'link_after' => '</span>',
  42. 'depth' => 1,
  43. ) );
  44. ?>
  45. </nav><!-- .social-navigation -->
  46. <?php endif; ?>
  47. </div><!-- .site-top-inner -->
  48. </div><!-- .site-top -->
  49. <?php endif; ?>
  50. <div class="site-branding">
  51. <?php canard_the_site_logo(); ?>
  52. <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  53. <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
  54. </div><!-- .site-branding -->
  55. <?php if ( get_header_image() ) : ?>
  56. <div class="header-image">
  57. <div class="header-image-inner">
  58. <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt=""></a>
  59. </div><!-- .header-image-inner -->
  60. </div><!-- .header-image -->
  61. <?php endif; // End header image check. ?>
  62. <div id="search-navigation" class="search-navigation">
  63. <div class="search-navigation-inner">
  64. <?php if ( has_nav_menu( 'primary' ) ) : ?>
  65. <nav id="site-navigation" class="main-navigation" role="navigation">
  66. <button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><span class="screen-reader-text"><?php _e( 'Primary Menu', 'canard' ); ?></span></button>
  67. <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu' ) ); ?>
  68. </nav><!-- #site-navigation -->
  69. <?php endif; ?>
  70. <div id="search-header" class="search-header">
  71. <button class="search-toggle" aria-controls="search-form" aria-expanded="false"><span class="screen-reader-text"><?php _e( 'Search', 'canard' ); ?></span></button>
  72. <?php get_search_form(); ?>
  73. </div><!-- #search-header -->
  74. </div><!-- .search-navigation-inner -->
  75. </div><!-- #search-navigation -->
  76. </header><!-- #masthead -->
  77. <div id="content" class="site-content">