<?php
/**
 * LoveWP WordPress theme.
 *
 * Please do not make any edits to this file. All edits should be done in a child theme.
 *
 */

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

// Set our theme version.
define( 'LOVEWP_VERSION', '1.6.0' );

if ( ! function_exists( 'lovewp_setup' ) ) {
	add_action( 'after_setup_theme', 'lovewp_setup' );
	/**
	 * Sets up theme defaults and registers support for various WordPress features.
	 *
	 */
	function lovewp_setup() {
		// Make theme available for translation.
		load_theme_textdomain( 'lovewp' );

		// Add theme support for various features.
		add_theme_support( 'automatic-feed-links' );
		add_theme_support( 'post-thumbnails' );
		add_theme_support( 'post-formats', array( 'aside', 'image', 'quote', 'link', 'status' ) );
		add_theme_support( 'woocommerce' );
		add_theme_support( 'title-tag' );
		add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'gallery', 'caption' ) );
				
		// Add theme support for selective refresh for widgets.
		add_theme_support( 'customize-selective-refresh-widgets' );
		
		// Add support for Block Styles.
		add_theme_support( 'wp-block-styles' );

		// Add support for full and wide align images.
		add_theme_support( 'align-wide' );
		
		// Add support for responsive embedded content.
		add_theme_support( 'responsive-embeds' );

		// Add support for custom line height controls.
		add_theme_support( 'custom-line-height' );

		// Add support for experimental cover block spacing.
		add_theme_support( 'custom-spacing' );

		add_theme_support( 'custom-logo', array(
			'height' => 70,
			'width' => 255,
			'flex-height' => true,
			'flex-width' => true
		) );
		
		add_theme_support( "custom-background",
			array(
				'default-color' 		 => 'ffffff',
				'default-image'          => '',
				'default-repeat'         => 'repeat',
				'default-position-x'     => 'left',
				'default-position-y'     => 'top',
				'default-size'           => 'auto',
				'default-attachment'     => '',
				'wp-head-callback'       => '_custom_background_cb',
				'admin-head-callback'    => '',
				'admin-preview-callback' => ''
			)
		);
		
		add_theme_support( "custom-header",
			array(
				'default-image'          => '',
				'flex-height'            => false,
				'flex-width'             => false,
				'uploads'                => true,
				'random-default'         => false,
				'header-text'            => false,
				'wp-head-callback'       => '',
				'admin-head-callback'    => '',
				'admin-preview-callback' => '',
			)
		);

		// Register primary menu.
		register_nav_menus( array(
			'primary' => __( 'Primary Menu', 'lovewp' ),
		) );

		/**
		 * Set the content width to something large
		 * We set a more accurate width in lovewp_smart_content_width()
		 */
		global $content_width;
		if ( ! isset( $content_width ) ) {
			$content_width = 1200; /* pixels */
		}

		// This theme styles the visual editor to resemble the theme style.
		add_editor_style( 'css/admin/editor-style.css' );
	}
}

/**
 * Get all necessary theme files
 */
require get_template_directory() . '/inc/theme-functions.php';
require get_template_directory() . '/inc/defaults.php';
require get_template_directory() . '/inc/class-css.php';
require get_template_directory() . '/inc/css-output.php';
require get_template_directory() . '/inc/general.php';
require get_template_directory() . '/inc/customizer.php';
require get_template_directory() . '/inc/markup.php';
require get_template_directory() . '/inc/element-classes.php';
require get_template_directory() . '/inc/typography.php';
require get_template_directory() . '/inc/plugin-compat.php';
require get_template_directory() . '/inc/class-tgm-plugin-activation.php';

if ( is_admin() ) {
	require get_template_directory() . '/inc/meta-box.php';
	require get_template_directory() . '/inc/dashboard.php';
}

/**
 * Load our theme structure
 */
require get_template_directory() . '/inc/structure/archives.php';
require get_template_directory() . '/inc/structure/comments.php';
require get_template_directory() . '/inc/structure/featured-images.php';
require get_template_directory() . '/inc/structure/footer.php';
require get_template_directory() . '/inc/structure/header.php';
require get_template_directory() . '/inc/structure/navigation.php';
require get_template_directory() . '/inc/structure/post-meta.php';
require get_template_directory() . '/inc/structure/sidebars.php';

define('LOVEWP_THEME_URL','https://wpkoi.com/lovewp-wpkoi-wordpress-theme/');
define('LOVEWP_WPKOI_AUTHOR_URL','https://wpkoi.com/');
define('LOVEWP_WPKOI_SOCIAL_URL','https://www.facebook.com/wpkoithemes/');
define('LOVEWP_WPKOI_WPORG_URL','https://wordpress.org/themes/author/wpkoithemes/');
define('LOVEWP_WPKOI_DRIBBLE_URL','https://dribbble.com/wpkoi');
define('LOVEWP_WPKOI_BEHANCE_URL','https://www.behance.net/wpkoi');
define('LOVEWP_WPKOI_INSTAGRAM_URL','https://www.instagram.com/wpkoithemes/');
define('LOVEWP_WPKOI_YOUTUBE_URL','https://www.youtube.com/channel/UCSCB8g7b6KbyJU97oST4P7A');
define('LOVEWP_WPKOI_TIKTOK_URL','https://www.tiktok.com/@wpkoithemes');
define('LOVEWP_WORDPRESS_REVIEW','https://wordpress.org/support/theme/lovewp/reviews/?filter=5');
define('LOVEWP_DOCUMENTATION','https://wpkoi.com/docs/');
define('LOVEWP_IMPORT','https://wpkoi.com/docs/import-free-content/');
define('LOVEWP_ELEMENTOR_DOCS','https://elementor.com/help/');
define('LOVEWP_SHOWCASE','https://wpkoi.com/docs/premium-showcase-for-basic-themes/');
define('LOVEWP_FONT_AWESOME_LINK','https://wpkoi.com/docs/custom-icons/');

if ( ! function_exists( 'lovewp_new_theme_uri_link' ) ) {
	function lovewp_new_theme_uri_link() {
		return 'https://wpkoi.com/lovewp-wpkoi-wordpress-theme/';
	}
}