<?php
/**
 * The header for our theme
 *
 * This is the template that displays all of the <head> section and everything up until <div id="content">
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package Social_Charity
 */

?>
<!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="https://gmpg.org/xfn/11">

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

<body <?php body_class(); ?>>

	<?php 
	  if ( function_exists( 'wp_body_open' ) ){
	    	wp_body_open();
	  }
	  else{ 
	  	do_action( 'wp_body_open' ); 
	  }
	?>
	<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'social-charity' ); ?></a>

	<header class="header--fixed">
		<?php 
		if(get_theme_mod( 'social_charity_top_header_enable' ) == '1'){
			get_template_part( 'header-parts/header','top' );
		}
		get_template_part( 'header-parts/header','bottom' );?>
	</header>
	<?php if( is_home() || (!is_front_page())):?>
	<nav class="breadcrumb-block mgb-lg" style="background: url(<?php if(has_header_image()):echo esc_url(get_header_image());endif;?>);">
		<div class="container">
			<div class="breadcrumb-holder">
				<div class="title">
					<?php if(is_home()): ?>
					<h1><?php bloginfo('name'); ?></h1>
					<?php else: ?>
						<?php if ( is_archive() ) {
							the_archive_title( '<h1>', '</h1>' );
						}
						else{
							echo '<h1>';
							echo esc_html( get_the_title() );
							echo '</h1>';
						} ?>
					<?php endif; ?>
				</div>
					
				<?php if(is_home()): ?>
				<ol class="breadcrumb">
					<li class="breadcrumb-item"><a href="<?php echo esc_url(home_url());?>"><?php bloginfo('name'); ?></a></li>
				</ol>
				<?php else:?> 
					<?php social_charity_breadcrumb_trail(); ?>
				<?php endif; ?>
			</div>
		</div>
	</nav>
<?php endif;?>

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