<?php
/*
 * Disallow direct access
 */
if( !defined( 'ABSPATH' ) ) {
    die( 'Forbidden.' );
}


/**
 * Edify functions and definitions
 */

 define( 'EDIFY_THEME', true );

if ( ! defined( 'EDIFY_VERSION' ) ) {
	// Replace the version number of the theme on each release.
	define( 'EDIFY_VERSION', '1.2.1' );
}

// shorthand contants for theme assets url
// ------------------------------------------------------------------------
define('EDIFY_THEME_URI', get_template_directory_uri());
define('EDIFY_THEME_ASSETS', get_template_directory_uri().'/assets');

define('EDIFY_IMG', EDIFY_THEME_ASSETS . '/images');
define('EDIFY_CSS', EDIFY_THEME_ASSETS . '/css');

define('EDIFY_PLUGINS', EDIFY_THEME_ASSETS . '/vendors');
define('EDIFY_JS',EDIFY_THEME_ASSETS . '/js');

define('EDIFY_THEME_DIR', get_template_directory());

define('EDIFY_INC',EDIFY_THEME_DIR . '/inc');
define('EDIFY_CORE',EDIFY_THEME_DIR . '/core');


/**
 * Core Setup
 */

 require EDIFY_CORE . '/setup.php';


/**
 * Sidebars Setup
 */
 


/**
 * Register widget area.
 *
 * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
 */
function edify_widgets_init() {
	register_sidebar(
		array(
			'name'          => esc_html__( 'Blog Sidebar', 'edify' ),
			'id'            => 'blog-sidebar',
			'description'   => esc_html__( 'Add widgets here.', 'edify' ),
			'before_widget' => '<section id="%1$s" class="widget %2$s">',
			'after_widget'  => '</section>',
			'before_title'  => '<h4 class="widget-title">',
			'after_title'   => '</h4>',
		)
	);	

	register_sidebar(
		array(
			'name'          => esc_html__( 'Shop Sidebar', 'edify' ),
			'id'            => 'shop-sidebar',
			'description'   => esc_html__( 'Add widgets here.', 'edify' ),
			'before_widget' => '<section id="%1$s" class="widget %2$s">',
			'after_widget'  => '</section>',
			'before_title'  => '<h4 class="widget-title">',
			'after_title'   => '</h4>',
		)
	);	

	/*
	 * Footer Top widget areas (4-column grid).
	 * Toggled on/off via the "Show Footer Top" Customizer switch
	 * (Appearance > Customize > Footer).
	 */
	for ( $i = 1; $i <= 4; $i++ ) {
		register_sidebar(
			array(
				/* translators: %d: footer column number (1-4) */
				'name'          => sprintf( esc_html__( 'Footer Column %d', 'edify' ), $i ),
				'id'            => 'footer-' . $i,
				'description'   => esc_html__( 'Add widgets here. Appears in the Footer Top section.', 'edify' ),
				'before_widget' => '<section id="%1$s" class="widget footer-widget %2$s">',
				'after_widget'  => '</section>',
				'before_title'  => '<h4 class="widget-title">',
				'after_title'   => '</h4>',
			)
		);
	}

}
add_action( 'widgets_init', 'edify_widgets_init' );

//  require EDIFY_CORE . '/sidebars.php';

 /**
 * Main Scripts
 */

require EDIFY_CORE . '/scripts.php';

/**
 * default Customizer additions.
 */
require EDIFY_INC . '/customizer.php';
require_once EDIFY_INC . '/edify-breadcrumb.php';
/**
 * Implement the Custom Header feature.
 */
require EDIFY_INC . '/custom-header.php';

/**
 * Custom template tags for this theme.
 */
require EDIFY_INC . '/template-tags.php';

/**
 * Plugin Activation
 */
require EDIFY_INC . '/tgm-plugin/plugin-active.php';

/**
 * Functions which enhance the theme by hooking into WordPress.
 */
require EDIFY_INC . '/template-functions.php';
require EDIFY_INC . '/edify-functions.php';
require EDIFY_INC . '/theme-style.php';

/**
 * WooCommerce Function
 */
if ( class_exists( 'WooCommerce' ) ) {
    require_once EDIFY_INC . '/woocommerce/edify-woocommerce.php';
}

/**
 * FluentCart Function
 */
if ( defined( 'FLUENTCART_VERSION' ) ) {
    require_once EDIFY_INC . '/fluentcart/edify-fluentcart.php';
}
/**
 * Customizer Function
 */

if(class_exists('kirki') ){
	require EDIFY_CORE . '/customizer/options.php';
}


/**
 * Header Footer
 */
require EDIFY_INC . '/header-footer.php';



