header.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 Libre 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', 'libre-2' ); ?></a>
  20. <?php if ( get_header_image() ) : ?>
  21. <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
  22. <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="custom-header">
  23. </a>
  24. <?php endif; // End header image check. ?>
  25. <header id="masthead" class="site-header" role="banner">
  26. <div class="site-branding">
  27. <?php if ( function_exists( 'the_custom_logo' ) ) : ?>
  28. <?php the_custom_logo(); ?>
  29. <?php endif; ?>
  30. <?php if ( is_front_page() && is_home() ) : ?>
  31. <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  32. <?php else : ?>
  33. <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
  34. <?php endif;
  35. $description = get_bloginfo( 'description', 'display' );
  36. if ( $description || is_customize_preview() ) : ?>
  37. <p class="site-description"><?php echo $description; ?></p>
  38. <?php endif; ?>
  39. </div><!-- .site-branding -->
  40. <div class="nav-wrapper">
  41. <nav id="site-navigation" class="main-navigation" role="navigation">
  42. <button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false">&#9776; <?php esc_html_e( 'Menu', 'libre-2' ); ?></button>
  43. <?php wp_nav_menu( array( 'theme_location' => 'menu-1', 'menu_id' => 'primary-menu' ) ); ?>
  44. <?php libre_2_social_menu(); ?>
  45. </nav><!-- #site-navigation -->
  46. <?php // Add Woocommerce Cart to header if Woocommerce exists
  47. if ( class_exists( 'WooCommerce' ) ) {
  48. libre_2_woocommerce_header_cart();
  49. }
  50. ?>
  51. </div>
  52. </header><!-- #masthead -->
  53. <div id="content" class="site-content">