<?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 meditest
 */

$meditest_preloader = meditest_get_option('preloader_enable', false);


?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>

<head>
	<meta charset="<?php bloginfo('charset'); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<?php wp_head(); ?>
</head>


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

	<?php wp_body_open(); ?>

	<!-- Theme Preloader -->
	<?php if (meditest_extra_is_activated() && $meditest_preloader == true) : ?>
		<?php require MEDITEST_THEME_DIR . '/template-parts/theme-preloader.php'; ?>
	<?php endif; ?>


	<div class="body-inner-content">

		<?php


		// Select Header Style
		$meditest_nav_style =  get_post_meta(get_the_ID(), 'meditest_post_meta', true); // Post Metabox
		$meditest_nav_global = meditest_get_option('nav_menu'); // Global


		if (meditest_extra_is_activated() && !empty($meditest_nav_style['page_nav_menu'])) {

			get_template_part('template-parts/headers/' . $meditest_nav_style['page_nav_menu'] . '');
		} elseif (meditest_extra_is_activated() && !empty($meditest_nav_global)) {

			get_template_part('template-parts/headers/' . $meditest_nav_global . '');
		} else {

			get_template_part('template-parts/headers/nav-style-one');
		}


		?>