<?php
/**
 * The header for our theme.
 *
 * Displays all of the <head> section and everything up till <div id="content">
 *
 * @package _xs
 */
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
    <head>
        <meta charset="<?php bloginfo('charset'); ?>">

        <?php
        /* SEO Description */
        $xs_desc = "";

        if (xs_get_option('theme_options', 'seo_desc') != "") {
            $xs_desc = xs_get_option('theme_options', 'seo_desc');
        }
        if (get_post_meta(get_the_ID(), 'xs_post_seo_desc', true) != "") {
            $xs_desc = get_post_meta(get_the_ID(), 'xs_post_seo_desc', true);
        }
        if (!empty($xs_desc)) {
            echo '<meta name="description" content="' . $xs_desc . '">';
        }

        /* SEO Keywords */
        $xs_keywords = "";

        if (xs_get_option('theme_options', 'seo_keywords') != "") {
            $xs_keywords = xs_get_option('theme_options', 'seo_keywords');
        }
        if (get_post_meta(get_the_ID(), 'xs_post_seo_keywords', true) != "") {
            $xs_keywords = get_post_meta(get_the_ID(), 'xs_post_seo_keywords', true);
        }

        if (!empty($xs_keywords)) {
            echo '<meta name="description" content="' . $xs_keywords . '">';
        }
        ?>

        <meta name="author" content="<?php bloginfo('name') ?>">

        <link rel="profile" href="http://gmpg.org/xfn/11">
        <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
        
        <!-- Mobile Specific Meta -->
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

        <!-- Favicon and Apple Icons -->
        <link rel="shortcut icon" href="<?php echo xs_get_option('theme_options', 'favicon'); ?>">
        <link rel="apple-touch-icon" href="<?php echo xs_get_option('theme_options', 'favicon'); ?>">
        <link rel="apple-touch-icon" sizes="72x72" href="<?php echo xs_get_option('theme_options', 'apple_touch_icon_72'); ?>">
        <link rel="apple-touch-icon" sizes="114x114" href="<?php echo xs_get_option('theme_options', 'apple_touch_icon_114'); ?>">
        <link rel="apple-touch-icon" sizes="144x144" href="<?php echo xs_get_option('theme_options', 'apple_touch_icon_144'); ?>">

        <?php xs_header_content(); ?>
        <?php wp_head(); ?>
    </head>

    <body <?php body_class(); ?>>
        <div class="xs-main-container" <?php xs_texture(); ?> >
            <div class="loader">
                <div class="loaded">&nbsp;</div>
            </div>
            <!-- start HEADER -->
            <section id="top" class="page-block">
                <header id="home">
                    <div class="container clearfix">
                        <div class="navigation">
                            <div class="row">
                                <div class="col-md-4 col-sm-3">
                                    <h1 class="logo">
                                        <a href="<?php echo esc_url(home_url('/')); ?>" title="<?php bloginfo('name'); ?>"><img class="img-responsive" src="<?php echo xs_get_option('theme_options', 'site_logo'); ?>" alt="OnEvent"></a></h1>
                                </div>
                                <div class="col-md-8 col-sm-9"> 
                                    <!-- Brand and toggle get grouped for better mobile display -->
                                    <div class="navbar navbar-default navbar-header visible-xs" role="navigation">
                                        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#Navigation"> 
                                            <span class="icon-bar"></span> 
                                            <span class="icon-bar"></span> 
                                            <span class="icon-bar"></span> 
                                        </button>
                                    </div>
                                    <nav>
                                        <?php
                                        wp_nav_menu(array(
                                            'menu' => 'primary',
                                            'theme_location' => 'primary',
                                            'depth' => 2,
                                            'container' => '',
                                            'container_class' => '',
                                            'container_id' => '',
                                            'menu_class' => 'list-inline collapse navbar-collapse',
                                            'menu_id' => 'Navigation',
                                            'fallback_cb' => 'wp_bootstrap_navwalker::fallback',
                                            'walker' => new wp_bootstrap_navwalker())
                                        );
                                        ?>

                                    </nav>
                                </div>
                                <!-- end col-md-10 --> 
                            </div>
                            <!--end-row--> 
                        </div>
                        <!-- end navigation --> 
                    </div>
                    <!-- end container --> 
                </header>


