false,'width' => 1600, 'height' => 500, 'flex-width' => true, 'flex-height' => true)); add_image_size('portfolio', apply_filters('cpotheme_thumbnail_width', CPOTHEME_THUMBNAIL_WIDTH), apply_filters('cpotheme_thumbnail_height', CPOTHEME_THUMBNAIL_HEIGHT), true); add_theme_support('custom-background', array('default-color' => apply_filters('cpotheme_background_color', 'ffffff'))); add_theme_support('automatic-feed-links'); add_theme_support('woocommerce'); add_theme_support('bbpress'); add_post_type_support('page', 'excerpt'); //Remove WordPress version number for security purposes remove_action('wp_head', 'wp_generator'); //Load translation text domain and make translation available $languages_path = get_template_directory().'/core-lite/languages'; if(defined('CPO_CORELITE')) $languages_path = CPO_CORELITE.'/languages'; load_theme_textdomain('cpocore', $languages_path); load_theme_textdomain('cpotheme', get_template_directory().'/languages'); $locale = get_locale(); $locale_file = get_template_directory()."/languages/$locale.php"; if(is_readable($locale_file)) require_once($locale_file); } } //Add Public scripts if(!function_exists('cpotheme_scripts_front')){ add_action('wp_enqueue_scripts', 'cpotheme_scripts_front'); function cpotheme_scripts_front( ){ $scripts_theme_path = get_template_directory_uri().'/scripts/'; $scripts_path = get_template_directory_uri().'/core-lite/scripts/'; if(defined('CPO_CORELITE_URL')) $scripts_path = CPO_CORELITE_URL.'/scripts/'; //Enqueue necessary scripts already in the WordPress core wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-widget'); wp_enqueue_script('jquery-effects-core'); wp_enqueue_script('jquery-effects-fade'); wp_enqueue_script('thickbox'); if(is_singular() && get_option('thread_comments')) wp_enqueue_script('comment-reply'); wp_enqueue_script('cpotheme_html5', $scripts_path.'html5.js'); //Register custom scripts for later enqueuing wp_enqueue_script('cpotheme_cycle', $scripts_path.'jquery-cycle.js', array(), false, true); wp_enqueue_script('cpotheme_prettyphoto', $scripts_path.'jquery-prettyphoto.js', array(), false, true); wp_enqueue_script('cpotheme_core', $scripts_path.'core.js', array(), false, true); wp_enqueue_script('cpotheme_general', $scripts_theme_path.'general.js', array(), false, true); } } //Add Admin scripts if(!function_exists('cpotheme_scripts_back')){ add_action('admin_enqueue_scripts', 'cpotheme_scripts_back'); function cpotheme_scripts_back(){ $screen = get_current_screen(); $scripts_theme_path = get_template_directory_uri().'/scripts/'; $scripts_path = get_template_directory_uri().'/core-lite/scripts/'; if(defined('CPO_CORELITE_URL')) $scripts_path = CPO_CORELITE_URL.'/scripts/'; //Common scripts wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-widget'); wp_enqueue_script('jquery-ui-datepicker'); wp_enqueue_script('jquery-effects-core'); wp_enqueue_script('jquery-effects-fade'); wp_enqueue_script('thickbox'); wp_enqueue_script('media-upload'); wp_enqueue_script('wp-color-picker'); wp_enqueue_script('cpotheme_script_admin', $scripts_path.'admin.js'); wp_register_script('cpotheme_script_editor', $scripts_path.'editor.js', array(), false, true); wp_register_script('cpotheme_script_codemirror', $scripts_path.'codemirror.js', array(), false, true); wp_register_script('cpotheme_script_codemirror_css', $scripts_path.'codemirror-css.js', array(), false, true); wp_register_script('cpotheme_script_codemirror_js', $scripts_path.'codemirror-js.js', array(), false, true); wp_register_script('cpotheme_script_codemirror_xml', $scripts_path.'codemirror-xml.js', array(), false, true); } } //Add public stylesheets if(!function_exists('cpotheme_add_styles')){ add_action('wp_enqueue_scripts', 'cpotheme_add_styles'); function cpotheme_add_styles(){ $stylesheets_path = get_template_directory_uri().'/core-lite/css/'; if(defined('CPO_CORELITE_URL')) $stylesheets_path = CPO_CORELITE_URL.'/css/'; //Common styles wp_enqueue_style('thickbox'); wp_enqueue_style('cpotheme-base', $stylesheets_path.'base.css'); wp_enqueue_style('cpotheme-prettyphoto', $stylesheets_path.'prettyphoto.css'); wp_enqueue_style('cpotheme-fontawesome', $stylesheets_path.'fontawesome.css'); wp_enqueue_style('cpotheme-main', get_bloginfo('stylesheet_url')); $responsive_styles = get_template_directory_uri().'/style-responsive.css'; wp_enqueue_style('cpotheme-base-responsive', $stylesheets_path.'base-responsive.css'); wp_enqueue_style('cpotheme-responsive', $responsive_styles); } } //Add admin stylesheets if(!function_exists('cpotheme_add_admin_styles')){ add_action('admin_print_styles', 'cpotheme_add_admin_styles'); function cpotheme_add_admin_styles(){ $stylesheets_path = get_template_directory_uri().'/core-lite/css/'; if(defined('CPO_CORELITE_URL')) $stylesheets_path = CPO_CORELITE_URL.'/css/'; wp_enqueue_style('wp-color-picker'); wp_enqueue_style('style_admin', $stylesheets_path.'admin.css'); wp_enqueue_style('style_fontawesome', $stylesheets_path.'fontawesome.css'); wp_enqueue_style('thickbox'); wp_register_style('cpotheme_style_codemirror', $stylesheets_path.'codemirror.css'); } } //Add all Core components $core_path = get_template_directory().'/core-lite/'; if(defined('CPO_CORELITE')) $core_path = CPO_CORELITE; //Classes require_once($core_path.'classes/class_menu.php'); //Main Components require_once($core_path.'admin.php'); 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.'custom.php'); require_once($core_path.'forms.php'); require_once($core_path.'settings.php'); require_once($core_path.'layout.php'); require_once($core_path.'woocommerce.php'); require_once($core_path.'menus.php'); //Metadata require_once($core_path.'metadata/data_general.php'); require_once($core_path.'metadata/data_settings.php'); require_once($core_path.'metadata/data_metaboxes.php');