header.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 Publication
  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. <a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'publication' ); ?></a>
  20. <div id="body-wrapper" class="body-wrapper">
  21. <div id="page" class="hfeed site">
  22. <header id="masthead" class="site-header" role="banner">
  23. <div class="site-header-inner">
  24. <div class="site-branding">
  25. <?php publication_the_site_logo(); ?>
  26. <?php if ( is_front_page() && is_home() ) : ?>
  27. <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  28. <?php else : ?>
  29. <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
  30. <?php endif; ?>
  31. <?php
  32. $description = get_bloginfo( 'description', 'display' );
  33. if ( $description || is_customize_preview() ) :
  34. ?>
  35. <p class="site-description"><?php echo $description; ?></p>
  36. <?php endif; ?>
  37. </div><!-- .site-branding -->
  38. </div><!-- .site-header-inner -->
  39. </header><!-- #masthead -->
  40. <?php if ( has_nav_menu( 'primary' ) || has_nav_menu( 'social' ) || is_active_sidebar( 'sidebar-1' ) || is_active_sidebar( 'sidebar-2' ) ) : ?>
  41. <button class="menu-toggle" aria-controls="slide-menu" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Menu', 'publication' ); ?></span></button>
  42. <div id="slide-menu" class="slide-menu">
  43. <div class="slide-wrapper">
  44. <?php if ( has_nav_menu( 'primary' ) ) : ?>
  45. <nav id="site-navigation" class="main-navigation" role="navigation">
  46. <h2 class="screen-reader-text"><?php esc_html_e( 'Primary Navigation', 'publication' ); ?></h2>
  47. <?php
  48. // Primary navigation menu.
  49. wp_nav_menu( array(
  50. 'container_class' => 'menu-wrapper',
  51. 'menu_id' => 'primary-menu',
  52. 'theme_location' => 'primary',
  53. ) );
  54. ?>
  55. </nav><!-- #site-navigation -->
  56. <?php endif; ?>
  57. <?php if ( has_nav_menu( 'social' ) ) : ?>
  58. <nav id="site-social" class="social-navigation">
  59. <h2 class="screen-reader-text"><?php esc_html_e( 'Social Navigation', 'publication' ); ?></h2>
  60. <?php
  61. // Social navigation menu.
  62. wp_nav_menu( array(
  63. 'container_class' => 'menu-wrapper',
  64. 'menu_id' => 'social-menu',
  65. 'theme_location' => 'social',
  66. 'link_before' => '<span class="screen-reader-text">',
  67. 'link_after' => '</span>',
  68. 'depth' => 1,
  69. ) );
  70. ?>
  71. </nav><!-- #site-social -->
  72. <?php endif; ?>
  73. </div><!-- .slide-wrapper -->
  74. <?php get_sidebar( 'menu' ); ?>
  75. </div><!-- .slide-menu -->
  76. <?php endif; ?>
  77. <div id="content" class="site-content">