 <?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div id="content">
 *
 * @package Petlove
 */
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width">
<link rel="profile" href="https://gmpg.org/xfn/11">
<?php if(is_singular() && pings_open()) { ?>
<link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' )); ?>">
<?php } ?>
<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
	<?php
	//wp_body_open hook from WordPress 5.2
	if ( function_exists( 'wp_body_open' ) ) {
	    wp_body_open();
	} else {
		do_action( 'wp_body_open' );
	}
?>
<a class="skip-link screen-reader-text" href="#sitemain">
	<?php _e( 'Skip to content', 'petlove' ); ?>
</a>
<div id="header">
            <div class="header-inner">	
				<div class="logo">
					<?php petlove_the_custom_logo(); ?>
						<h1><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php esc_attr(bloginfo( 'name' )); ?></a></h1>

					<?php $description = get_bloginfo( 'description', 'display' );
					if ( $description || is_customize_preview() ) : ?>
						<p><?php echo esc_html($description); ?></p>
					<?php endif; ?>
				</div>
                <?php if(get_theme_mod('email-txt') != '' || get_theme_mod('phone-txt') != '') { ?>
                    <div class="header-right">
                    	<?php if(get_theme_mod('phone-txt') != '') { ?>
                        <span><i class="fa fa-phone"></i><?php echo esc_html(get_theme_mod('phone-txt')); ?></span>
                        <?php } ?>
                        <?php if(get_theme_mod('email-txt') != '') { ?>
                        <span><i class="fa fa-envelope"></i><a href="<?php echo esc_url('mailto:'.sanitize_email(get_theme_mod('email-txt'))); ?>"><?php echo sanitize_email(get_theme_mod('email-txt')); ?></a></span>  
                        <?php } ?>          
                    </div><!-- header-right -->
				<?php } ?><div class="clear"></div> 				
            </div><!-- header-inner -->  
            <div class="navi-inner">
            		<div class="toggle">
						<a class="toggleMenu" href="#"><?php esc_html_e('Menu','petlove'); ?></a>
				</div> 						
				<div class="main-nav">
						<?php wp_nav_menu( array('theme_location' => 'primary') ); ?>							
				</div><!-- main-nav -->	
				<div class="searchbar"><?php echo get_search_form(false);?></div><!-- searchbar -->
                <div class="clear"></div>
            </div><!-- navi-innner -->             
		</div><!-- header -->