<?php
/**
 * Page header for our theme.
 *
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package Wacko
 */

if ( ! function_exists( 'wacko_page_header_section' ) ) :

  function wacko_page_header_section(){
    
    $bg_image_url = get_header_image();
    ?>

    <?php if ( has_header_image() ) { ?>

    <div class="header-bg">

        <figure>

          <img src="<?php echo esc_url( $bg_image_url ); ?>">

        </figure>

        <div class="overlay">
        </div><!--overlay-2-->
      </div><!--header-bg-->

    <?php
      }
    }

  endif;

add_action( 'wacko_page_header', 'wacko_page_header_section', 10 );
