header.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 WordPress
  10. * @subpackage Twenty_Nineteen
  11. * @since 1.0.0
  12. */
  13. ?><!doctype html>
  14. <html <?php language_attributes(); ?>>
  15. <head>
  16. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  17. <meta name="viewport" content="width=device-width, initial-scale=1" />
  18. <link rel="profile" href="https://gmpg.org/xfn/11" />
  19. <?php wp_head(); ?>
  20. </head>
  21. <body <?php body_class(); ?>>
  22. <?php wp_body_open(); ?>
  23. <div id="page" class="site">
  24. <a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'twentynineteen' ); ?></a>
  25. <?php // If FSE plugin is active, use Header template for content. ?>
  26. <?php if( class_exists( 'A8C\FSE\WP_Template' ) ) : ?>
  27. <header id="masthead" class="<?php echo is_singular() && twentynineteen_can_show_post_thumbnail() ? 'site-header featured-image' : 'site-header'; ?>">
  28. <?php
  29. $template = new A8C\FSE\WP_Template();
  30. $template->output_template_content( A8C\FSE\WP_Template::HEADER );
  31. ?>
  32. </header>
  33. <?php endif; ?>
  34. <?php // Otherwise we'll fall back to default Twenty Nineteen header below. ?>
  35. <?php if( ! class_exists( 'A8C\FSE\WP_Template' ) ) : ?>
  36. <header id="masthead" class="<?php echo is_singular() && twentynineteen_can_show_post_thumbnail() ? 'site-header featured-image' : 'site-header'; ?>">
  37. <div class="site-branding-container">
  38. <?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
  39. </div><!-- .site-branding-container -->
  40. <?php if ( is_singular() && twentynineteen_can_show_post_thumbnail() ) : ?>
  41. <div class="site-featured-image">
  42. <?php
  43. twentynineteen_post_thumbnail();
  44. the_post();
  45. $discussion = ! is_page() && twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null;
  46. $classes = 'entry-header';
  47. if ( ! empty( $discussion ) && absint( $discussion->responses ) > 0 ) {
  48. $classes = 'entry-header has-discussion';
  49. }
  50. ?>
  51. <div class="<?php echo $classes; ?>">
  52. <?php get_template_part( 'template-parts/header/entry', 'header' ); ?>
  53. </div><!-- .entry-header -->
  54. <?php rewind_posts(); ?>
  55. </div>
  56. <?php endif; ?>
  57. </header><!-- #masthead -->
  58. <?php endif; ?>
  59. <div id="content" class="site-content">