header.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 Independent_Publisher_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', 'independent-publisher-2' ); ?></a>
  20. <div id="hero-header" class="site-hero-section">
  21. <header id="masthead" class="site-header" role="banner">
  22. <div class="inner">
  23. <div class="site-branding">
  24. <?php the_custom_logo(); ?>
  25. <?php if ( '' !== get_theme_mod( 'independent_publisher_2_gravatar_email', get_option( 'admin_email' ) ) && validate_gravatar( get_theme_mod( 'independent_publisher_2_gravatar_email', get_option( 'admin_email' ) ) ) ) : ?>
  26. <a class="site-logo-link" href="<?php echo esc_url( home_url( '/' ) ); ?>">
  27. <?php
  28. echo get_avatar(
  29. get_theme_mod( 'independent_publisher_2_gravatar_email', get_option( 'admin_email' ) ),
  30. 80,
  31. '',
  32. '',
  33. array( 'class' => array( 'site-logo-image' ), 'loading' => 'eager' )
  34. );
  35. ?>
  36. </a><!-- .site-logo-link -->
  37. <?php endif;
  38. if ( is_front_page() && is_home() ) : ?>
  39. <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  40. <?php else : ?>
  41. <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
  42. <?php
  43. endif;
  44. $description = get_bloginfo( 'description', 'display' );
  45. if ( $description || is_customize_preview() ) : ?>
  46. <p class="site-description"><?php echo $description; /* WPCS: xss ok. */ ?></p>
  47. <?php endif; ?>
  48. </div><!-- .site-branding -->
  49. <?php independent_publisher_2_social_menu(); ?>
  50. <?php if ( has_nav_menu( 'menu-1' ) ) : ?>
  51. <button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false" id="primary-menu-button">
  52. <?php esc_html_e( 'Menu', 'independent-publisher-2' ); ?>
  53. </button><!-- .menu-toggle -->
  54. <?php endif; ?>
  55. </div><!-- .inner -->
  56. </header><!-- #masthead -->
  57. </div>
  58. <?php if ( function_exists( 'ip_woocommerce_header_cart' ) ) : ?>
  59. <div id="menu-with-cart">
  60. <?php endif; ?>
  61. <?php if ( has_nav_menu( 'menu-1' ) ) : ?>
  62. <nav id="site-navigation" class="main-navigation" role="navigation">
  63. <?php wp_nav_menu( array( 'theme_location' => 'menu-1', 'menu_id' => 'primary-menu' ) ); ?>
  64. </nav><!-- .main-navigation -->
  65. <?php endif; ?>
  66. <?php if ( function_exists( 'ip_woocommerce_header_cart' ) ) : ?>
  67. <nav id="wc-navigation" class="main-navigation" role="navigation">
  68. <?php ip_woocommerce_header_cart(); ?>
  69. </nav>
  70. <?php endif; ?>
  71. <?php if ( function_exists( 'ip_woocommerce_header_cart' ) ) : ?>
  72. </div>
  73. <?php endif; ?>
  74. <div id="content-wrapper" class="content-wrapper">
  75. <div id="content" class="site-content">