<?php

/**
 * NeatNote Theme functions and definitions
 *
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * @package WordPress
 * @subpackage NeatNote
 * @since 1.0.0
 * 
 * Google Fonts License:
 * This theme uses Google Fonts which are licensed under the SIL Open Font License (OFL).
 * Font License: https://scripts.sil.org/OFL
 * All fonts are served from Google's CDN and are free to use.
 */

/**
 * Sets up theme defaults and registers support for various WordPress features.
 *
 * Note that this function is hooked into the after_setup_theme hook, which
 * runs before the init hook. The init hook is too late for some features, such
 * as indicating support for post thumbnails.
 */
define('NEATNOTE_VERSION', '1.0.0');
if (! function_exists('neatnote_setup')) :
	function neatnote_setup()
	{
		/*
		 * Make theme available for translation.
		 * Translations can be filed in the /languages/ directory.
		 * If you're building a theme based on NeatNote Theme, use a find and replace
		 * to change 'neatnote' to the name of your theme in all the template files.
		 */
		load_theme_textdomain('neatnote', get_template_directory() . '/languages');

		// Add default posts and comments RSS feed links to head.
		add_theme_support('automatic-feed-links');

		/*
		 * Let WordPress manage the document title.
		 * By adding theme support, we declare that this theme does not use a
		 * hard-coded <title> tag in the document head, and expect WordPress to
		 * provide it for us.
		 */
		add_theme_support('title-tag');

		/*
		 * Enable support for Post Thumbnails on posts and pages.
		 *
		 * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
		 */
		add_theme_support('post-thumbnails');
		set_post_thumbnail_size(1568, 9999);

		// This theme uses wp_nav_menu() in two locations.
		register_nav_menus(
			array(
				'neatnote-header-menu' => __('Header Menu', 'neatnote'),
				'neatnote-footer-menu' => __('Footer Menu', 'neatnote'),
				'neatnote-footer-contact-menu' => __('Footer Contact Menu', 'neatnote'),
				'neatnote-social-menu' =>  __('Social Menu', 'neatnote'),
			)
		);
		/**
		 * Add support for core custom logo.
		 *
		 * @link https://codex.wordpress.org/Theme_Logo
		 */
		add_theme_support(
			'custom-logo',
			array(
				'height'      => 180,
				'width'       => 180,
				'flex-width'  => true,
				'flex-height' => true,
			)
		);
		add_theme_support('wp-block-styles');
		add_theme_support('responsive-embeds');
		add_theme_support('html5', ['search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script']);
		add_theme_support('custom-header', [
			'default-image'          => '',
			'width'                  => 1200,
			'height'                 => 600,
			'flex-width'             => true,
			'flex-height'            => true,
			'wp-head-callback'       => '_custom_background_cb',
		]);
		add_theme_support('custom-background', [
			'default-color'          => 'ffffff',
			'default-image'          => '',
			'wp-head-callback'       => '_custom_background_cb',
		]);
		add_theme_support('align-wide');
	}
endif;
add_action('after_setup_theme', 'neatnote_setup');

//include theme setting file
require get_template_directory() . '/includes/theme-setting/neatnote-font-loader-functions.php';
require get_template_directory() . '/includes/theme-setting/neatnote-theme-scripts.php';
require get_template_directory() . '/includes/theme-setting/neatnote-functions.php';
require get_template_directory() . '/includes/customizer/customizer.php';
