<?php
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Templates use local variables supplied by the render context.
if (!defined('ABSPATH')) {
    exit;
}

$nexdirectory_is_block_theme = function_exists('wp_is_block_theme') && wp_is_block_theme();

if ($nexdirectory_is_block_theme) {
    ?><!doctype html>
<html <?php language_attributes(); ?>>
<head>
    <meta charset="<?php bloginfo('charset'); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php
wp_body_open();
} else {
    get_header();
}
?>
<main id="nexdirectory-app-template-shell" class="nexdirectory-app-template-shell" role="main">
    <?php while (have_posts()) : the_post(); ?>
        <?php // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- the_content is a WordPress core hook. ?>
        <?php
        $nexdirectory_content_markup = NEXDIRECTORY_Escaping::prepare_markup_for_wp_kses((string) apply_filters('the_content', (string) get_the_content()));
        echo wp_kses($nexdirectory_content_markup, NEXDIRECTORY_Escaping::allowed_html($nexdirectory_content_markup));
        ?>
        <?php // phpcs:enable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound ?>
    <?php endwhile; ?>
</main>
<?php
if ($nexdirectory_is_block_theme) {
    wp_footer();
    ?>
</body>
</html>
    <?php
} else {
    get_footer();
}
