<?php
/**
 * Header file for the NewsNation WordPress theme.
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package NewsNation
 * @since 1.0.0
 */
?><!DOCTYPE html>
<html class="no-js" <?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();
} ?>

<div class="preloader hide-no-js">
    <div class="preloader-style preloader-style-1"></div>
</div>

<div id="page" class="hfeed site">
    <a class="skip-link screen-reader-text" href="#content"><?php esc_html_e('Skip to the content', 'newsnation'); ?></a>
    <?php
    $newsnation_default = newsnation_get_default_theme_options();
    $ed_header_subscription_news = get_theme_mod('ed_header_subscription_news', $newsnation_default['ed_header_subscription_news']);
    $ed_header_subscription_posts_title = get_theme_mod('ed_header_subscription_posts_title', $newsnation_default['ed_header_subscription_posts_title']);
    $header_subscription_image = get_theme_mod('header_subscription_image');
    $ed_header_subscription_shortcode = get_theme_mod('ed_header_subscription_shortcode');
    ?>
    <?php if ($ed_header_subscription_news) { ?>
        <div class="theme-modal">
            <div class="theme-modal-content">
                <a href="" class='theme-modal-close'>
                    <?php newsnation_theme_svg('cross'); ?>
                </a>
                <div class="theme-modal-image data-bg data-bg-big" data-background='<?php echo esc_url($header_subscription_image); ?>'></div>
                <div class="theme-modal-detail">
                    <h2 class="entry-title- entry-title-medium">
                        <?php echo esc_html($ed_header_subscription_posts_title); ?>
                    </h2>
                    <?php echo do_shortcode($ed_header_subscription_shortcode); ?>
                </div>
            </div>
        </div>
    <?php } ?>
    <?php newsnation_header_ad(); ?>
    <?php get_template_part('template-parts/header', 'content'); ?>
    <?php newsnation_header_banner(); ?>
    <div id="content" class="site-content">


                    <?php
                    $newsnation_post_layout = get_post_meta( get_the_ID(), 'newsnation_post_layout', true );
                    if ( is_front_page() && !is_paged() ) {
                        newsnation_header_ticker_posts();
                    }
                    elseif ( is_archive() ) {
                        newsnation_header_ticker_posts();
                    }
                    elseif ( is_singular() && $newsnation_post_layout != 'layout-2' ) {
                        newsnation_header_ticker_posts();
                    }
                    ?>