header.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * The header for our theme.
  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 Karuna
  10. */
  11. ?><!DOCTYPE html>
  12. <html <?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', 'karuna' ); ?></a>
  23. <header id="masthead" class="site-header" role="banner">
  24. <?php get_template_part( 'components/header/site', 'top-bar' ); ?>
  25. <?php get_template_part( 'components/header/site', 'branding' ); ?>
  26. <?php if ( class_exists( 'WooCommerce' ) && ( is_woocommerce() || is_cart() || is_checkout() ) ) : ?>
  27. <?php // Silence. ?>
  28. <?php elseif ( karuna_has_post_thumbnail() && karuna_jetpack_featured_image_display() && ( is_single() || is_page() ) ) : ?>
  29. <?php the_post_thumbnail( 'karuna-hero' ); ?>
  30. <?php elseif ( is_post_type_archive( 'jetpack-testimonial' ) ) :
  31. $jetpack_options = get_theme_mod( 'jetpack_testimonials' );
  32. if ( isset( $jetpack_options['featured-image'] ) && '' != $jetpack_options['featured-image'] ) :
  33. echo wp_get_attachment_image( (int)$jetpack_options['featured-image'], 'karuna-hero' );
  34. endif;
  35. elseif ( get_header_image() ) : ?>
  36. <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">
  37. <?php endif; // End featured/header image check. ?>
  38. <?php get_template_part( 'components/header/site', 'bottom-bar' ); ?>
  39. </header>
  40. <div id="content" class="site-content">