<?php
/**
 * The custom header for our theme
 *
 * This is the template that displays all of the <head> section and everything up until <div id="content">
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package Buzz_Agency
 */

function buzz_agency_header_callback() { ?>

      <div class="hgroup-wrap">
            <div class="container">
                  <section class="site-branding">
                        <!-- site branding starting from here -->
                        <?php 
                        $site_identity = get_theme_mod( 'site_identity_options', 'title-text' );

                        $title = get_bloginfo( 'name', 'display' );
                        $description    = get_bloginfo( 'description', 'display' );	

                        if ( 'logo-only' == $site_identity ) { 
                              if ( has_custom_logo() ){
                                    the_custom_logo();
                              }
                        } elseif ( 'logo-text' == $site_identity ) {
                              if ( has_custom_logo() ) {
                                    the_custom_logo();
                              }
                              if ( $description ) {
                                    echo '<p class="site-description">'.esc_html( $description ).'</p>';
                              }
                        } elseif ( 'title-only' == $site_identity && $title ) {

                              if ( is_front_page() && is_home() ) { ?>
                                    <h1 class="site-title">
                                          <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
                                    </h1>   
                              <?php } else { ?>
                                    <p class="site-title">
                                          <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
                                    </p>    
                              <?php }

                        } elseif ( 'title-text' == $site_identity ) {
                              if ( $title ) {
                                    if ( is_front_page() && is_home() ) { ?>
                                          <h1 class="site-title">
                                          <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
                                          </h1>
                                    <?php } else { ?>
                                          <p class="site-title">
                                          <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
                                          </p>    
                                    <?php }
                              }
                              if ( $description ) {
                                    echo '<p class="site-description">'.esc_html( $description ).'</p>';	
                              }
                        } ?>
                        <!-- <span class="site-description">satisfied home</span> -->
                  </section> <!-- site branding ends here -->

                  <div class="hgroup-right">
                        <div id="navbar" class="navbar">
                              <!-- navbar starting from here -->
                              <nav id="site-navigation" class="navigation main-navigation" role="navigation">
                                    <a href="javascript:void(0)" class="header-menu-icon">&#9776;</a>
                                    <div class="menu-content-wrapper">
                                          <div class="menu-top-menu-container">
                                                <?php
                                                wp_nav_menu( array(
                                                'theme_location' => 'menu-1',
                                                ) );
                                                ?>
                                          <a class="header-menu-close-icon" href="javascript:void(0)"><?php esc_html_e('close','buzz-agency')?></a>
                                          </div>

                                    </div>
                                   
                              </nav>
                              <!-- #site-navigation -->
                        </div>
                        <!-- navbar ends here -->
                        <div id="left-search" class="header-search-section">
                              <div class="search-toggle">
                                    <a href="javascript:void(0)"><i class="fa"></i></a>
                              </div>
                        </div>
                  </div>
            </div>
      </div>

	<?php do_action('buzz_agency_search'); ?>
	
<?php
}
add_action('buzz_agency_header_callback_action','buzz_agency_header_callback');		


