<?php 
/**
 * Trending news theme header
**/ 
?>
<!DOCTYPE html>
<html <?php language_attributes();?>>
<head>


<title>
<?php
        if ( is_single() ) { single_post_title(); }
        elseif ( is_home() || is_front_page() ) { bloginfo('name'); print ' - '; bloginfo('description'); get_page_number(); }
        elseif ( is_page() ) { single_post_title(''); }
        elseif ( is_search() ) { bloginfo('name'); print ' - Search results for ' . esc_html($s); get_page_number(); }
        elseif ( is_404() ) { bloginfo('name'); print ' - Not Found'; }
        else { bloginfo('name'); wp_title('-'); get_page_number(); }
    ?>
</title>
<!-- keywords description author -->
<meta name="keywords" content="<?php wp_title(); echo '  '; bloginfo( 'name' ); echo ' , '; bloginfo( 'keywords' ); ?>" />
<meta name="description" content="<?php wp_title(); echo '  '; bloginfo( 'description' ); ?>" />
<!--apple icon-->
<link rel="apple-touch-icon" href="<?php echo get_option('tn_apple_touch_icon'); ?>"/>
<!--favicon-->
<link rel="shortcut icon" href="<?php echo get_option('tn_favicon'); ?>" />
<!--stylesheet-->
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
<!--viewport-->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!--charset-->
<meta http-equiv="content-type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<!--rss-comments-->
<link rel="alternate" type="application/rss+xml" href="<?php bloginfo('comments_rss2_url') ?>"/>
<!--rss-->
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
<!--atom-->
<link rel="alternate" type="application/atom+xml" title="Atom" href="<?php bloginfo('atom_url'); ?>" />
<!--pingback-->
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />



<!--Facebook Open Graph-->
	<!--FB page title-->
<meta property="og:title" content="<?php if (is_single() || is_page()) {the_title();} else {bloginfo('name');} ?>" />
	<!--FB description-->
<meta property="og:description" content="<?php if (is_single() || is_page()) {echo substr(strip_tags($post->post_content), 0, 200); echo '...';} else {bloginfo('description');} ?>"/>
	<!--FB url-->
<meta property="og:url" content="<?php if ( is_home() || is_front_page() ){echo home_url();} else{the_permalink();} ?>"/>
	<!--FB image-->
<meta property="og:image" content="<?php if (is_single() || is_page()) {$fbthumb = wp_get_attachment_image_src(get_post_thumbnail_id(), 'slider'); echo $fbthumb[0];} else {echo get_option('tn_logo');}?>" />  
	<!--FB type-->
<meta property="og:type" content="<?php if (is_single() || is_page()) { echo "article"; } else { echo "website";} ?>"/>
	<!--FB site name-->
<meta property="og:site_name" content="<?php bloginfo('name'); ?>"/>


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

<body <?php body_class(); ?>>
<header id="header">
	<div id="top-navigation">
			<nav id="top-menu">
				<?php wp_nav_menu(array('theme_location' => 'top-menu', 'depth' => 1)); ?>
			</nav><!--top-menu-->
            <div class="top-menu-title-date">
                <div id="top-menu-title-side">
                    <?php echo get_option('tn_today_date'); ?>
                </div><!--top-menu-title-side-->
                <div id="top-menu-today-date">
                    <?php echo date('F j'); ?>
                </div><!--top-menu-today-date-->
            </div><!--top-menu-title-date-->
	</div><!--top-navigation-->
	<div id="logo">
		<div id="site-logo">
			<a href="<?php echo home_url(); ?>"><img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="<?php bloginfo( 'name' ); ?>"/></a>	
		</div><!--site-logo-->
		<div id="ticker">
			<?php ticker(); ?>
		</div><!--ticker--> 
        <?php if(get_option('tn_instagram')||get_option('tn_youtube')||get_option('tn_google')||get_option('tn_pinterest')||get_option('tn_twitter')||get_option('tn_facebook')) { ?>
        <div id="content-social">
            <ul>
                <?php if(get_option('tn_facebook')) { ?>
                <li><a href="http://www.facebook.com/<?php echo get_option('tn_facebook'); ?>" class="fb-social-icon" target="_blank"></a></li>
                <?php } ?>
                <?php if(get_option('tn_twitter')) { ?>
                <li><a href="http://www.twitter.com/<?php echo get_option('tn_twitter'); ?>" class="twitter-social-icon" target="_blank"></a></li>
                <?php } ?>
                <?php if(get_option('tn_pinterest')) { ?>
                <li><a href="http://www.pinterest.com/<?php echo get_option('tn_pinterest'); ?>" class="pinterest-social-icon" target="_blank"></a></li>
                <?php } ?>
                <?php if(get_option('tn_google')) { ?>
                <li><a href="https://plus.google.com/<?php echo get_option('tn_google'); ?>/posts" class="google-social-icon" target="_blank"></a></li>
                <?php } ?>
                <?php if(get_option('tn_youtube')) { ?>
                <li><a href="http://www.youtube.com/user/<?php echo get_option('tn_youtube'); ?>" class="youtube-social-icon" target="_blank"></a></li>
                <?php } ?>
                <?php if(get_option('tn_instagram')) { ?>
                <li><a href="http://instagram.com/<?php echo get_option('tn_instagram'); ?>" class="instagram-social-icon" target="_blank"></a></li>
                <?php } ?>

                <li><a href="<?php bloginfo('rss_url'); ?>" class="rss-social-icon"></a></li>
            </ul>
		</div><!--content-social-->  
        <?php } ?> 
        
	</div><!--logo-->
	<div id="nav-wrapper">
		<div id="navigation">
			<nav id="main-nav">
				<div id="mob-menu">
					&#9776;  Menu
				</div><!--mob-menu-->
				<?php wp_nav_menu(array(
				'theme_location' => 'main-menu',
				'depth' => 3, 
				'walker' => new tn_super_menu()
				)); ?>
				<div class="search-box">
					<?php get_search_form(); ?>
				</div><!--search-box-->
			</nav><!--main-nav-->
		</div><!--navigation-->
	</div><!--nav-wrapper-->
</header><!--header-->

<section id="wrapper" class="hfeed">