false,'width' => 1600, 'height' => 500, 'flex-width' => true, 'flex-height' => true)); add_theme_support('custom-background', apply_filters('cpotheme_background_args', array('default-color' => 'ffffff'))); add_theme_support('automatic-feed-links'); add_theme_support('woocommerce'); add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); add_theme_support('bbpress'); add_theme_support('custom-logo', array('width' => 240, 'flex-width' => true, 'flex-height' => true)); //Set content width for embeds global $content_width; if(!isset($content_width)) $content_width = 640; //Load translation text domain and make translation available $languages_path = get_template_directory().'/core/languages'; if(defined('CPOTHEME_CORELITE')) $languages_path = CPOTHEME_CORELITE.'/languages'; load_theme_textdomain('affluent', $languages_path); $locale = get_locale(); $locale_file = get_template_directory()."/languages/$locale.php"; if(is_readable($locale_file)) require_once($locale_file); // Backward compatibility for epsilon framework $epsilon = get_option( 'epsilon_framework_update' ); if ( !$epsilon ) { $req_plugins = get_option( 'affluent_show_recommended_plugins' ); $updated_req_plugins = array(); if ( !empty( $req_plugins ) ) { foreach ($req_plugins as $key => $value) { $updated_req_plugins[$key] = $value ? false : true; } update_option( 'affluent_show_recommended_plugins', $updated_req_plugins ); } add_option( 'epsilon_framework_update', true ); } } } //Add Public scripts add_action('wp_enqueue_scripts', 'cpotheme_scripts_front'); if(!function_exists('cpotheme_scripts_front')){ function cpotheme_scripts_front( ){ $scripts_theme_path = get_template_directory_uri().'/scripts/'; $scripts_path = get_template_directory_uri().'/core/scripts/'; if(defined('CPOTHEME_CORELITE_URL')) $scripts_path = CPOTHEME_CORELITE_URL.'/scripts/'; //Enqueue necessary scripts already in the WordPress core //wp_enqueue_script('jquery-ui-core'); if(is_singular() && get_option('thread_comments')) wp_enqueue_script('comment-reply'); wp_enqueue_script('cpotheme-html5', $scripts_path.'html5-min.js'); //Register custom scripts for later enqueuing wp_enqueue_script('cpotheme-core', $scripts_path.'core.js', array(), false, true); wp_enqueue_script('cpotheme-cycle', $scripts_path.'jquery-cycle2-min.js', array('jquery'), false, true); wp_enqueue_script('cpotheme-magnific', $scripts_path.'jquery-magnific-min.js', array('jquery'), false, true); } } //Add Admin scripts add_action('admin_enqueue_scripts', 'cpotheme_scripts_back'); if(!function_exists('cpotheme_scripts_back')){ function cpotheme_scripts_back(){ $screen = get_current_screen(); if($screen->base == 'post'){ $scripts_path = get_template_directory_uri().'/core/scripts/'; if(defined('CPOTHEME_CORELITE_URL')) $scripts_path = CPOTHEME_CORELITE_URL.'/scripts/'; wp_enqueue_script('cpotheme-script-admin', $scripts_path.'admin.js', array('jquery')); } } } //Add public stylesheets add_action('wp_enqueue_scripts', 'cpotheme_add_styles'); if(!function_exists('cpotheme_add_styles')){ function cpotheme_add_styles(){ $stylesheets_path = get_template_directory_uri().'/core/css/'; if(defined('CPOTHEME_CORELITE_URL')) $stylesheets_path = CPOTHEME_CORELITE_URL.'/css/'; //Common styles wp_enqueue_style('cpotheme-base', $stylesheets_path.'base.css'); wp_register_style('cpotheme-magnific', $stylesheets_path.'magnific.css'); wp_enqueue_style('cpotheme-main', get_stylesheet_uri()); //Font Libraries wp_register_style('cpotheme-fontawesome', $stylesheets_path.'icon-fontawesome.css'); } } //Add admin stylesheets add_action('admin_print_styles', 'cpotheme_add_admin_styles'); if(!function_exists('cpotheme_add_admin_styles')){ function cpotheme_add_admin_styles(){ $stylesheets_path = get_template_directory_uri().'/core/css/'; if(defined('CPOTHEME_CORELITE_URL')) $stylesheets_path = CPOTHEME_CORELITE_URL.'/css/'; wp_register_style('cpotheme-admin', $stylesheets_path.'admin.css'); wp_register_style('cpotheme-fontawesome', $stylesheets_path.'icon-fontawesome.css'); $screen = get_current_screen(); if( isset($screen->base) && $screen->base == 'post'){ add_editor_style($stylesheets_path.'editor.css'); wp_enqueue_style('cpotheme-admin'); wp_enqueue_style('cpotheme-fontawesome'); } } } add_action('admin_print_styles-appearance_page_cpotheme-welcome', 'cpotheme_add_admin_styles_welcome'); if(!function_exists('cpotheme_add_admin_styles_welcome')){ function cpotheme_add_admin_styles_welcome(){ $stylesheets_path = get_template_directory_uri().'/core/css/'; if(defined('CPOTHEME_CORELITE_URL')) $stylesheets_path = CPOTHEME_CORELITE_URL.'/css/'; wp_enqueue_style('cpotheme-admin', $stylesheets_path.'welcome.css'); } } //Add all Core components $core_path = get_template_directory().'/core/'; if(defined('CPOTHEME_CORELITE')) $core_path = CPOTHEME_CORELITE; //Classes require_once($core_path.'classes/class_customizer.php'); require_once($core_path.'classes/class_menu.php'); //Main Components require_once($core_path.'functions.php'); require_once($core_path.'markup.php'); require_once($core_path.'filters.php'); require_once($core_path.'meta.php'); require_once($core_path.'metaboxes.php'); require_once($core_path.'forms.php'); require_once($core_path.'taxonomy.php'); require_once($core_path.'icons.php'); require_once($core_path.'layout.php'); require_once($core_path.'woocommerce.php'); require_once($core_path.'menus.php'); require_once($core_path.'customizer.php'); require_once($core_path.'sections.php'); //Metadata require_once($core_path.'metadata/data_general.php'); require_once($core_path.'metadata/data_icons.php'); require_once($core_path.'metadata/data_metaboxes.php'); require_once($core_path.'metadata/data_customizer.php');