
<div class="header-wrapper header-two">

    <?php if( true === get_theme_mod( 'header_top_menu', true ) || true === get_theme_mod( 'header_top_social', true ) ) : ?>
    <div class="header-top-wrapper">
        <div class="container">
            <div class="header-top-inner">
                <?php if ( get_theme_mod( 'header_top_menu', true ) ) : ?>
                    <nav class="header-top-menu navbar navbar-expand-lg navbar-light">
                        <?php
                            wp_nav_menu(
                                array(
                                    'container' 		  => false,
                                    'theme_location' 	=> 'headertop',
                                    'menu_id'        	=> 'header-top',
                                    'menu_class'        => 'sf-menu',
                                    'fallback_cb'       => 'newshit_top_menu_navigation_fallback',
                                )
                            );
                        ?>
                    </nav>
                <?php endif; ?>

                <?php if( true === get_theme_mod( 'header_top_social', true ) ) : ?>
                    <?php if(!empty(get_theme_mod( 'header_social_icons' ))) : ?>
                    <div class="header-top-social">
                        <ul>
                            <?php foreach(get_theme_mod( 'header_social_icons' ) as $social ) : ?>
                            <li>
                                <a href="<?php echo esc_url($social['link']); ?>" title="<?php echo esc_attr( $social['name'] ); ?>" target="<?php echo esc_attr( $social['target'] ); ?>" style="color:<?php echo esc_attr($social['color']); ?>"><i class="<?php echo esc_attr($social['icon']); ?>"></i></a>
                            </li>
                            <?php endforeach; ?>
                        </ul>
                    </div>
                    <?php endif; ?>
                <?php endif; ?>
                <div id="topheader"></div>
            </div>
       </div>
    </div>
    <?php endif; ?>

    <div class="header-center-wrapper">
        <div class="container">
            <div class="header-center-box">
                <div class="row align-items-center">
                    <div class="<?php echo esc_attr( true === get_theme_mod( 'header_center_ads_enable', true ) ? 'col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4 with-ads' : 'col-12 no-ads') ?>">
                        <div class="header-logo-wrapper">
                            <div class="site-branding">
                                <?php
                                if( has_custom_logo() ){
                                    the_custom_logo();
                                } else {
                                    ?>
                                    <h2 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h2>
                                    <?php 
                                    $newshit_description = get_bloginfo( 'description', 'display' );
                                    if ( $newshit_description || is_customize_preview() ) :
                                        ?>
                                            <p class="site-description"><?php echo $newshit_description; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
                                        <?php
                                    endif; 
                                }?>
                            </div><!-- .site-branding -->
                        </div>
                    </div>
                    <?php if( true === get_theme_mod( 'header_center_ads_enable', true ) ) : ?>
                    <div class="col-12 col-sm-6 col-md-8 col-lg-8 col-xl-8">
                        <div class="newshit-header-ads-wrapper">
                            <div class="header-ads-inner">
                                <?php if( get_theme_mod( 'header2_ads_options', 'link' ) === 'link' && !empty(get_theme_mod( 'header2_ads_image'))) :
                                
                                    $ads = get_theme_mod( 'header2_ads_image');
                                    $ads_alt = get_post_meta( $ads['id'], '_wp_attachment_image_alt', true );
                                    $ads_title = get_the_title( $ads['id']);
                                ?>
                                    <a href="<?php echo esc_url_raw(get_theme_mod( 'header2_ads_url')) ?>">
                                        <img src="<?php echo esc_url($ads['url']); ?>" alt="<?php echo esc_attr($ads_alt); ?>" title="<?php echo esc_attr($ads_title); ?>">
                                    </a>

                                <?php else : ?>
                                    <img src="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/image/ads/header-ads.png" alt="<?php esc_attr_e( 'NewsHit ads', 'newshit' ); ?>">
                                <?php endif; ?>

                            </div>
                        </div>
                    </div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
    <?php do_action( 'newshit_action_navication_menu' ); ?>
</div>