<?php
/**
 * The Header template for our theme
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *
 * @package WordPress
 * @subpackage Probit
 *
 */
?><!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) & !(IE 8)]><!-->
<html <?php language_attributes(); ?>>
    <!--<![endif]-->
    <head>
        <meta charset="<?php bloginfo('charset'); ?>" />
        <meta name="viewport" content="width=device-width" />
        <link rel="profile" href="http://gmpg.org/xfn/11" />
        <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
        <?php wp_head(); ?>
    </head>

    <body <?php body_class(); ?>>
        <div id="page" class="hfeed site">
            <header id="masthead" class="site-header" role="banner">
                <div class="top-header">
                    <div class="container">
                        <div class="row">
                            <div class="head-social col-md-9 col-sm-8 col-xs-12 social-bar">
                                <div class="sol_shareicondiv small <?php echo esc_attr(get_theme_mod('iconshape')); ?>">
                                    <?php
                                    if (get_theme_mod('facebook') != '') {
                                        ?>
                                        <a class="sol_shareicon facebook" href="<?php echo esc_url(get_theme_mod('facebook')); ?>" target="_blank"><i class="fa fa-facebook"></i></a>
                                        <?php
                                    }

                                    if (get_theme_mod('twitter') != '') {
                                        ?>
                                        <a class="sol_shareicon twitter" href="<?php echo esc_url(get_theme_mod('twitter')); ?>" target="_blank"><i class="fa fa-twitter"></i></a>
                                        <?php
                                    }

                                    if (get_theme_mod('email') != '') {
                                        ?>
                                        <a class="sol_shareicon mail" href="<?php echo "mailto:" . esc_attr(get_theme_mod('email')); ?>"><i class="fa fa-envelope-o"></i></a>
                                        <?php
                                    }

                                    if (get_theme_mod('pinterest') != '') {
                                        ?>
                                        <a class="sol_shareicon pinterest" href="<?php echo esc_url(get_theme_mod('pinterest')); ?>" target="_blank"><i class="fa fa-pinterest"></i></a>
                                        <?php
                                    }

                                    if (get_theme_mod('googleplus') != '') {
                                        ?>
                                        <a class="sol_shareicon google-plus" href="<?php echo esc_url(get_theme_mod('googleplus')); ?>" target="_blank"><i class="fa fa-google-plus"></i></a>
                                        <?php
                                    }

                                    if (get_theme_mod('rssfeed') != '') {
                                        ?>
                                        <a class="sol_shareicon rss" href="<?php echo esc_url(get_theme_mod('rssfeed')); ?>" target="_blank"><i class="fa fa-rss"></i></a>
                                        <?php
                                    }

                                    if (get_theme_mod('instagram') != '') {
                                        ?>
                                        <a class="sol_shareicon instagram" href="<?php echo esc_url(get_theme_mod('instagram')); ?>" target="_blank"><i class="fa fa-instagram"></i></a>
                                        <?php
                                    }

                                    if (get_theme_mod('linkedin') != '') {
                                        ?>
                                        <a class="sol_shareicon linkedin" href="<?php echo esc_url(get_theme_mod('linkedin')); ?>" target="_blank"><i class="fa fa-linkedin"></i></a>
                                        <?php
                                    }

                                    if (get_theme_mod('youtube') != '') {
                                        ?>
                                        <a class="sol_shareicon youtube" href="<?php echo esc_url(get_theme_mod('youtube')); ?>" target="_blank"><i class="fa fa-youtube"></i></a>
                                        <?php
                                    }
                                    if (get_theme_mod('flicker') != '') {
                                        ?>
                                        <a class="sol_shareicon flickr" href="<?php echo esc_url(get_theme_mod('flicker')); ?>" target="_blank"><i class="fa fa-flickr"></i></a>
                                        <?php
                                    }
                                    ?>
                                </div>
                            </div>
                            <div class="head-search col-sm-4 col-md-3 col-xs-12 social-bar">
                                <?php get_search_form(); ?>
                            </div>
                        </div><!-- .row -->
                    </div><!-- .container -->
                </div>
                <div class="main-header">
                    <div class="container">
                        <div class="row">
                            <?php
                            $blog_name = esc_attr(get_bloginfo('name'));
                            $description = esc_attr(get_bloginfo('description', 'display'));
                            $logo = esc_attr(get_theme_mod('custom_logo'));
                            ?>
                            <div class="col-md-3 col-sm-3 clearfix <?php echo ($logo != '') ? "logo-img" : "logo-text"; ?>">
                                <?php
                                if ($logo != '' && function_exists('the_custom_logo')) {
                                    ?><h1 class="site-title"><?php
                                    the_custom_logo();
                                    ?></h1><?php
                                } elseif (is_front_page() || is_home()) {
                                    ?> <h1 class="site-title <?php echo (!empty($description)) ? "tagline" : "notagline"; ?>"><a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></h1> <?php
                                        if ($description || is_customize_preview()) {
                                            ?> <p class="site-description"><?php echo $description; ?></p> <?php
                                        }
                                    } else {
                                        ?> <h2 class="site-title <?php echo (!empty($description)) ? "tagline" : "notagline"; ?>"><a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></h2> <?php
                                    if ($description || is_customize_preview()) {
                                        ?> <p class="site-description"><?php echo $description; ?></p> <?php
                                        }
                                    }
                                    ?>
                            </div>
                            <div class="col-md-9 col-sm-9 clearfix">
                                <nav id="site-navigation" class="main-navigation" role="navigation">
                                    <?php
                                    // Call primary menu of theme
                                    wp_nav_menu(array('theme_location' => 'primary', 'menu_class' => 'nav-menu sf-menu'));
                                    ?>
                                </nav><!-- #site-navigation -->
                            </div>
                        </div><!-- .row -->
                    </div><!-- .container -->
                </div>
            </header><!-- #masthead -->

            <?php
            // Call Avartan slider on home page
            include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
            if (is_front_page() && is_plugin_active('avartan-slider-lite/avartanslider.php')) {
                if ((function_exists("avartanslider"))) {
                    $homepage_slider = esc_attr(get_theme_mod('homepage_avartan_slider'));
                    $avartan_id = trim($homepage_slider);
                    if (!empty($avartan_id)) {
                        global $wpdb;
                        $avartanTable = $wpdb->prefix . 'avartan_sliders';
                        $avartan_alias = $wpdb->get_var("SELECT alias from $avartanTable WHERE id = " . $avartan_id);
                        ?>
                        <div class="slider_div">
                            <?php if (function_exists("avartanslider")) avartanslider($avartan_alias); ?>
                        </div>
                        <?php
                    } else {
                        if (get_header_image()) :
                            /**
                             * Filter the default twentysixteen custom header sizes attribute.
                             *
                             * @since Twenty Sixteen 1.0
                             *
                             * @param string $custom_header_sizes sizes attribute
                             * for Custom Header. Default '(max-width: 709px) 85vw,
                             * (max-width: 909px) 81vw, (max-width: 1362px) 88vw, 1200px'.
                             */
                            $custom_header_sizes = apply_filters('twentysixteen_custom_header_sizes', '(max-width: 709px) 85vw, (max-width: 909px) 81vw, (max-width: 1362px) 88vw, 1200px');
                            ?>
                            <div class="header-image">
                                <a href="<?php echo esc_url(home_url('/')); ?>" rel="home">
                                    <img src="<?php header_image(); ?>" srcset="<?php echo esc_attr(wp_get_attachment_image_srcset(get_custom_header()->attachment_id)); ?>" sizes="<?php echo esc_attr($custom_header_sizes); ?>" width="<?php echo esc_attr(get_custom_header()->width); ?>" height="<?php echo esc_attr(get_custom_header()->height); ?>" alt="<?php echo esc_attr(get_bloginfo('name', 'display')); ?>">
                                </a>
                            </div><!-- .header-image --><?php
                        endif;
                    }
                }
            }else {
                if (get_header_image()) :
                    /**
                     * Filter the default twentysixteen custom header sizes attribute.
                     *
                     * @since Twenty Sixteen 1.0
                     *
                     * @param string $custom_header_sizes sizes attribute
                     * for Custom Header. Default '(max-width: 709px) 85vw,
                     * (max-width: 909px) 81vw, (max-width: 1362px) 88vw, 1200px'.
                     */
                    $custom_header_sizes = apply_filters('twentysixteen_custom_header_sizes', '(max-width: 709px) 85vw, (max-width: 909px) 81vw, (max-width: 1362px) 88vw, 1200px');
                    ?>
                    <div class="header-image">
                        <a href="<?php echo esc_url(home_url('/')); ?>" rel="home">
                            <img src="<?php header_image(); ?>" srcset="<?php echo esc_attr(wp_get_attachment_image_srcset(get_custom_header()->attachment_id)); ?>" sizes="<?php echo esc_attr($custom_header_sizes); ?>" width="<?php echo esc_attr(get_custom_header()->width); ?>" height="<?php echo esc_attr(get_custom_header()->height); ?>" alt="<?php echo esc_attr(get_bloginfo('name', 'display')); ?>">
                        </a>
                    </div><!-- .header-image --><?php
                endif;
            }
            ?>
            <div id="main" class="wrapper">