<?php
/**
 * The Header for our theme.
 *
 * Displays all the <head> section and everything up till <div id="content">
 *
 * @package upTown
 */
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<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(); ?>>

<?php wp_body_open(); ?>

<div id="page" class="hfeed site">
	
	<a class="skip-link screen-reader-text" href="#content">
		<?php
		/* translators: Hidden accessibility text. */
		esc_html_e( 'Skip to content', 'uptown' );
		?>
	</a>

	<?php do_action( 'before' ); ?>
	
	<div id="masthead-wrap" class="site-header-wrap wrap">
	
		<header id="masthead" class="site-header" role="banner">

			<?php
			/**
			 * We check individual logo settings here. If there is an alternative
			 * logo and the option of the individual page is activated, we use it.
			 * If not the regular logo is used.
			 */

			// set default logo
			$logo = apply_filters( 'wpsight_uptown_logo', UPTOWN_THEME_URI . '/img/logo.png' );

            // remove default logo when site name (title) exists
			if( ! empty( get_bloginfo( 'name' ) ) ) {
				$logo = '';
			}

            // we get the custom logo, if available
			$custom_logo_id = get_theme_mod( 'custom_logo' );
            if( $custom_logo_id ) {
				$arr  = wp_get_attachment_image_src( $custom_logo_id , 'full' );
				$logo = apply_filters( 'wpsight_uptown_logo', $arr[0] );
			}

			if ( ! empty( $logo ) ) {
				?>
				<div class="site-branding">
					<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><img src="<?php echo esc_url( $logo ); ?>" alt="<?php bloginfo( 'name' ); ?>" /></a>
				</div><!-- #site-branding -->			
				<?php
			} else {
				?>
				<div class="site-branding">
					<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
				</div><!-- #site-branding -->
				<?php
			}

			$show_description = get_theme_mod( 'deactivate_tagline' );
			if ( empty( $show_description ) ) {
				$description_tag = is_front_page() ? 'p' : 'div';
				?>
				<<?php echo esc_html( $description_tag ); ?> class="site-description"><?php echo esc_html( bloginfo( 'description' ) ); ?></<?php echo esc_html( $description_tag ); ?>> 
				<?php
			}
			
			$header_right = get_option( 'header-right', __( 'Call us today - 1 (800) 234 567', 'uptown' ) );
			if( ! empty( $header_right ) ) { ?>	
				<div class="site-header-right">
				<?php echo $header_right; ?>
				</div>
			
			<?php } ?>
    	    
		</header><!-- #masthead -->
	
	</div><!-- #masthead-wrap -->
	
	<?php if (has_nav_menu('primary')) : ?>
	<div class="menu-container site-navigation-wrap">
		<button class="menu-button" aria-controls="site-navigation" aria-expanded="false">
			<?php esc_html_e( 'Menu', 'uptown' ); ?>
		</button>
	<div id="site-header-menu" class="site-header-menu site-navigation-wrap">
		<nav id="site-navigation" class="main-navigation clear" role="navigation" aria-label="<?php _e( 'Primary menu', 'uptown' ); ?>">
			
			<?php wp_nav_menu( array( 'theme_location' => 'primary', 'depth' => 3, ) ); ?>
			
		</nav><!-- #site-navigation -->
	</div>
	</div><!-- #site-navigation-wrap -->
	<?php endif; ?>
        
	<?php get_template_part( 'content', 'subheader' ); ?>
	
	<div id="content-wrap" class="site-content-wrap">

		<div id="content" class="site-content">
