<?php

/**
 * This is the primary functions theme file.
 * This file gets and includes theme functions.
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
 * @package Glaciers
 * @since 1.0.0
 */

if (!defined('ABSPATH')) {
	exit; // Exit if accessed directly.
}

// Define Constants
define('BOOTSRAP_VERSION', '5.3.0');
define('GLACIER_VERSION', '1.0.0');
define('GLACIER_THEME_DIR', trailingslashit(get_template_directory()));
define('GLACIER_THEME_URI', trailingslashit(esc_url(get_template_directory_uri())));

// This theme requires WordPress 4.7 or later.
if (version_compare($GLOBALS['wp_version'], '4.7', '<')) {
	require_once GLACIER_THEME_DIR . '/inc/back-compat.php';
}

/* ADDITIONAL FUNCTIONS & CLASSES
@since Glaciers 1.0.0
   ==================================================== */
// Core
require_once GLACIER_THEME_DIR . '/inc/setup.php';
require_once GLACIER_THEME_DIR . '/inc/glaciers-enqueue.php';

// Function files
//require_once GLACIER_THEME_DIR . '/inc/internal-styles.php';
require_once GLACIER_THEME_DIR . '/inc/template-functions.php';
require_once GLACIER_THEME_DIR . '/inc/internal-styles.php';
require_once GLACIER_THEME_DIR . '/inc/sidebars.php';
require_once GLACIER_THEME_DIR . '/inc/block-patterns.php';

// Classes
require_once GLACIER_THEME_DIR . '/inc/classes/class-glaciers-comment-walker.php';
require_once GLACIER_THEME_DIR . '/inc/classes/class-glaciers-svg-icons.php';
require_once GLACIER_THEME_DIR . '/inc/svg-icons.php';

// Customizer
require_once GLACIER_THEME_DIR . '/inc/customizer/custom-controls/custom-control.php';
require_once GLACIER_THEME_DIR . '/inc/customizer/customizer.php';

// Load theme structure
require_once GLACIER_THEME_DIR . '/template-parts/layout/header-layout.php';
require_once GLACIER_THEME_DIR . '/template-parts/layout/blog-layout.php';
require_once GLACIER_THEME_DIR . '/template-parts/layout/post-layout.php';
require_once GLACIER_THEME_DIR . '/template-parts/layout/footer-layout.php';

/* LOAD JETPACK COMPATIBILITY FILE
   ==================================================== */
if (defined('JETPACK__VERSION')) {
	require get_template_directory() . '/inc/jetpack.php';
}
