header.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 popper
  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. <!-- https://codex.wordpress.org/Conditional_Tags#Is_a_Page_Template -->
  22. <?php if(is_page_template( 'page-templates/page-sidebar-right.php' ) ) { ?>
  23. <div id="page" class="hfeed site sidebar-right">
  24. <?php } else { ?>
  25. <div id="page" class="hfeed site <?php echo get_theme_mod( 'layout_setting', 'no-sidebar' ); ?>">
  26. <?php
  27. }
  28. ?>
  29. <a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'popper-child' ); ?></a>
  30. <?php
  31. if ( get_header_image() ) { ?>
  32. <header id="masthead" class="site-header header-background-image" style="background-image: url(<?php echo get_header_image(); ?>) " role="banner">
  33. <?php } else { ?>
  34. <header id="masthead" class="site-header" role="banner">
  35. <?php }
  36. ?>
  37. <div class="site-logo">
  38. <?php $site_title = get_bloginfo( 'name' ); ?>
  39. <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
  40. <div class="screen-reader-text">
  41. <?php printf( esc_html__('Go to the home page of %1$s', 'popper-child'), $site_title ); ?>
  42. </div>
  43. <?php
  44. // Display logo if Custom Logo or Site Icon is defined, otherwise display First Letter
  45. if ( popper_custom_logo() ) {
  46. echo popper_custom_logo();
  47. } else { ?>
  48. <div class="site-firstletter" aria-hidden="true">
  49. <?php echo substr($site_title, 0, 1); ?>
  50. </div>
  51. <?php } ?>
  52. </a>
  53. </div>
  54. <div class="site-branding<?php if ( !is_front_page() && is_singular() ) { echo ' screen-reader-text'; } ?>">
  55. <?php if ( is_front_page() && is_home() ) : ?>
  56. <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  57. <?php else : ?>
  58. <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
  59. <?php endif; ?>
  60. <?php
  61. $description = get_bloginfo( 'description', 'display' );
  62. if ( $description || is_customize_preview() ) : ?>
  63. <p class="site-description"><?php echo $description; /* WPCS: xss ok. */ ?></p>
  64. <?php endif; ?>
  65. </div><!-- .site-branding -->
  66. <?php if ( has_nav_menu( 'primary' ) ) : ?>
  67. <nav id="site-navigation" class="main-navigation" role="navigation">
  68. <button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><?php esc_html_e( 'Menu', 'popper-child' ); ?></button>
  69. <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu', 'menu_class' => 'nav-menu' ) ); ?>
  70. </nav><!-- #site-navigation -->
  71. <?php endif; ?>
  72. </header><!-- #masthead -->
  73. <div id="content" class="site-content">