Advertisement
Guest User

Child Theme header.php

a guest
Jul 5th, 2017
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.63 KB | None | 0 0
  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_Seventeen
  11.  * @since 1.0
  12.  * @version 1.0
  13.  */
  14.  
  15. ?><!DOCTYPE html>
  16. <html <?php language_attributes(); ?> class="no-js no-svg">
  17. <head>
  18. <meta charset="<?php bloginfo( 'charset' ); ?>">
  19. <meta name="viewport" content="width=device-width, initial-scale=1">
  20. <link rel="profile" href="http://gmpg.org/xfn/11">
  21.  
  22. <?php wp_head(); ?>
  23. </head>
  24.  
  25. <body <?php body_class(); ?>>
  26. <div id="page" class="site">
  27.     <a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'twentyseventeen' ); ?></a>
  28.  
  29.     <header id="masthead" class="site-header" role="banner">
  30.  
  31.         <?php
  32.         if ( has_post_thumbnail() && is_single() ) :
  33.         ?>
  34.             <div class="custom-header">
  35.                 <div class="custom-header-media">
  36.                     <div id="wp-custom-header" class="wp-custom-header">
  37.                         <?php the_post_thumbnail( 'twentyseventeen-featured-image'); ?>
  38.                     </div><!-- .wp-custom-header -->
  39.                 </div><!-- .custom-header-media -->
  40.                 <div class="site-branding">
  41.                     <div class="wrap">
  42.                         <div class="site-branding-text">
  43.                             <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
  44.                         </div><!-- .site-branding-text -->
  45.                     </div><!-- .wrap -->
  46.                 </div><!-- .site-branding -->
  47.             </div><!-- .custom-header -->
  48.         <?php
  49.         else :
  50.             get_template_part( 'template-parts/header/header', 'image' );
  51.         endif;
  52.         ?>
  53.  
  54.         <?php if ( has_nav_menu( 'top' ) ) : ?>
  55.             <div class="navigation-top">
  56.                 <div class="wrap">
  57.                     <?php get_template_part( 'template-parts/navigation/navigation', 'top' ); ?>
  58.                 </div><!-- .wrap -->
  59.             </div><!-- .navigation-top -->
  60.         <?php endif; ?>
  61.  
  62.     </header><!-- #masthead -->
  63.  
  64.     <?php
  65.  
  66.     /*
  67.      * If a regular post or page, and not the front page, show the featured image.
  68.      * Using get_queried_object_id() here since the $post global may not be set before a call to the_post().
  69.      */
  70.     if ( ( is_single() || ( is_page() && ! twentyseventeen_is_frontpage() ) ) && has_post_thumbnail( get_queried_object_id() ) ) :
  71.         echo '<div class="single-featured-image-header">';
  72.         echo get_the_post_thumbnail( get_queried_object_id(), 'twentyseventeen-featured-image' );
  73.         echo '</div><!-- .single-featured-image-header -->';
  74.     endif;
  75.     ?>
  76.  
  77.     <div class="site-content-contain">
  78.         <div id="content" class="site-content">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement