'Etoile Theme Companion', 'slug' => 'etoile-theme-companion', 'required' => false, ), array( 'name' => 'Ultimate Slider', 'slug' => 'ultimate-slider', 'required' => false, ), array( 'name' => 'Status Tracking', 'slug' => 'order-tracking', 'required' => false, ), ); // Only uncomment the strings in the config array if you want to customize the strings. $config = array( 'id' => 'keep-calm-and-ecomm', // Unique ID for hashing notices for multiple instances of TGMPA. 'default_path' => '', // Default absolute path to bundled plugins. 'menu' => 'tgmpa-install-plugins', // Menu slug. 'has_notices' => true, // Show admin notices or not. 'dismissable' => true, // If false, a user cannot dismiss the nag message. 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. 'is_automatic' => false, // Automatically activate plugins after installation or not. 'message' => '', // Message to output right before the plugins table. ); tgmpa( $plugins, $config ); } /* ===================================================================== Load text domain ===================================================================== */ add_action('after_setup_theme', 'ewd_kcae_text_domain'); function ewd_kcae_text_domain(){ load_theme_textdomain('keep-calm-and-ecomm', get_template_directory() . '/lang'); } /* ===================================================================== Add customizable navigation ===================================================================== */ function ewd_kcae_register_my_menu() { register_nav_menu('main-menu', __('Main Menu', 'keep-calm-and-ecomm')); } add_action( 'init', 'ewd_kcae_register_my_menu' ); /* ===================================================================== Widgetize sidebar and footer ===================================================================== */ function ewd_kcae_widgets_init() { register_sidebar( array( 'name' => __('Page Sidebar', 'keep-calm-and-ecomm'), 'id' => 'sidebar_widget', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __('Blog Sidebar', 'keep-calm-and-ecomm'), 'id' => 'sidebar_widget_blog', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __('Footer', 'keep-calm-and-ecomm'), 'id' => 'footer_widget', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'ewd_kcae_widgets_init' ); /* ===================================================================== Post thumbnails ===================================================================== */ add_action( 'after_setup_theme', 'ewd_kcae_post_thumbnails' ); function ewd_kcae_post_thumbnails(){ add_theme_support('post-thumbnails'); //set_post_thumbnail_size(250, 250, true); } /* ===================================================================== Custom background ===================================================================== */ add_action( 'after_setup_theme', 'ewd_kcae_custom_background' ); function ewd_kcae_custom_background(){ $args = array( 'default-color' => 'ffffff', ); add_theme_support( 'custom-background', $args ); } /* ===================================================================== Feeds ===================================================================== */ add_action( 'after_setup_theme', 'ewd_kcae_automatic_feed_links' ); function ewd_kcae_automatic_feed_links(){ add_theme_support( 'automatic-feed-links' ); } /* ===================================================================== Content width ===================================================================== */ if ( ! isset( $content_width ) ) $content_width = 960; /* ===================================================================== Title tag ===================================================================== */ add_action( 'after_setup_theme', 'ewd_kcae_slug_setup' ); function ewd_kcae_slug_setup(){ add_theme_support( 'title-tag' ); } /* ===================================================================== Custom logo ===================================================================== */ add_action( 'after_setup_theme', 'ewd_kcae_custom_header' ); function ewd_kcae_custom_header(){ add_theme_support( "custom-header" ); if ( ! defined('NO_HEADER_TEXT') ){ define( 'NO_HEADER_TEXT', true ); } } function ewd_kcae_custom_logo() { add_theme_support( 'custom-logo' ); } add_action( 'after_setup_theme', 'ewd_kcae_custom_logo' ); /* ===================================================================== Threaded comments ===================================================================== */ function ewd_kcae_threaded_comments(){ if ( is_singular() && get_option( 'thread_comments' ) ){ wp_enqueue_script( 'comment-reply' ); } } add_action( 'comment_form_before', 'ewd_kcae_threaded_comments' ); /* ===================================================================== Customizer Stuff ===================================================================== */ function ewd_kcae_customize_register( $wp_customize ){ include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); $pluginThemeCompanion = "etoile-theme-companion/etoile-theme-companion.php"; $installedThemeCompanion = is_plugin_active($pluginThemeCompanion); $pluginOTP = "order-tracking/Main.php"; $installedOTP = is_plugin_active($pluginOTP); $wp_customize->remove_section('background_image'); $wp_customize->get_section('header_image')->title = __( 'Logo', 'keep-calm-and-ecomm'); if ( function_exists('the_custom_logo') ){ $wp_customize->remove_section('header_image'); } // LOGO HEIGHT $wp_customize->add_setting( 'ewd_kcae_setting_logo_height', array( 'default' => '24px', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_text_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_logo_height', array( 'section' => 'title_tagline', 'label' => __( 'Logo Height', 'keep-calm-and-ecomm' ), 'description' => __( 'Specify the logo height in pixels (e.g. 24px)', 'keep-calm-and-ecomm' ), 'type' => 'text', ) ); // LOGO TOP MARGIN $wp_customize->add_setting( 'ewd_kcae_setting_logo_top_margin', array( 'default' => '28px', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_text_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_logo_top_margin', array( 'section' => 'title_tagline', 'label' => __( 'Logo Top Margin', 'keep-calm-and-ecomm' ), 'description' => __( 'Specify the margin above the logo in pixels (e.g. 28px)', 'keep-calm-and-ecomm' ), 'type' => 'text', ) ); /*============== START COLOURS ==============*/ // TEXT COLOR $wp_customize->add_setting( 'ewd_kcae_setting_text_color', array( 'default' => '#999', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_color_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ewd_kcae_setting_text_color', array( 'label' => __( 'Text Color', 'keep-calm-and-ecomm' ), 'section' => 'colors', 'settings' => 'ewd_kcae_setting_text_color' ) ) ); // LINK COLOR $wp_customize->add_setting( 'ewd_kcae_setting_link_color', array( 'default' => '#037751', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_color_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ewd_kcae_setting_link_color', array( 'label' => __( 'Link Color', 'keep-calm-and-ecomm' ), 'section' => 'colors', 'settings' => 'ewd_kcae_setting_link_color' ) ) ); // HEADER BACKGROUND COLOR $wp_customize->add_setting( 'ewd_kcae_setting_header_background_color', array( 'default' => '#fff', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_color_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ewd_kcae_setting_header_background_color', array( 'label' => __( 'Header Background Color', 'keep-calm-and-ecomm' ), 'section' => 'colors', 'settings' => 'ewd_kcae_setting_header_background_color' ) ) ); // MENU TEXT COLOR $wp_customize->add_setting( 'ewd_kcae_setting_menu_text_color', array( 'default' => '#111', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_color_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ewd_kcae_setting_menu_text_color', array( 'label' => __( 'Menu Text Color', 'keep-calm-and-ecomm' ), 'section' => 'colors', 'settings' => 'ewd_kcae_setting_menu_text_color' ) ) ); // MENU TEXT HOVER COLOR $wp_customize->add_setting( 'ewd_kcae_setting_menu_text_hover_color', array( 'default' => '#037751', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_color_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ewd_kcae_setting_menu_text_hover_color', array( 'label' => __( 'Menu Text Hover Color', 'keep-calm-and-ecomm' ), 'section' => 'colors', 'settings' => 'ewd_kcae_setting_menu_text_hover_color' ) ) ); // MENU DROP DOWN BACKGROUND COLOR $wp_customize->add_setting( 'ewd_kcae_setting_menu_dropdown_background_color', array( 'default' => '#111', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_color_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ewd_kcae_setting_menu_dropdown_background_color', array( 'label' => __( 'Menu Drop Down Background Color', 'keep-calm-and-ecomm' ), 'section' => 'colors', 'settings' => 'ewd_kcae_setting_menu_dropdown_background_color' ) ) ); // MENU DROP DOWN BACKGROUND HOVER COLOR $wp_customize->add_setting( 'ewd_kcae_setting_menu_dropdown_background_hover_color', array( 'default' => '#fff', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_color_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ewd_kcae_setting_menu_dropdown_background_hover_color', array( 'label' => __( 'Menu Drop Down Background Hover Color', 'keep-calm-and-ecomm' ), 'section' => 'colors', 'settings' => 'ewd_kcae_setting_menu_dropdown_background_hover_color' ) ) ); // MENU DROP DOWN TEXT COLOR $wp_customize->add_setting( 'ewd_kcae_setting_menu_dropdown_text_color', array( 'default' => '#fff', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_color_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ewd_kcae_setting_menu_dropdown_text_color', array( 'label' => __( 'Menu Drop Down Text Color', 'keep-calm-and-ecomm' ), 'section' => 'colors', 'settings' => 'ewd_kcae_setting_menu_dropdown_text_color' ) ) ); // MENU DROP DOWN TEXT HOVER COLOR $wp_customize->add_setting( 'ewd_kcae_setting_menu_dropdown_text_hover_color', array( 'default' => '#111', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_color_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ewd_kcae_setting_menu_dropdown_text_hover_color', array( 'label' => __( 'Menu Drop Down Text Hover Color', 'keep-calm-and-ecomm' ), 'section' => 'colors', 'settings' => 'ewd_kcae_setting_menu_dropdown_text_hover_color' ) ) ); // PAGE TITLE BAR BACKGROUND COLOR $wp_customize->add_setting( 'ewd_kcae_setting_page_title_bar_background_color', array( 'default' => '#037751', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_color_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ewd_kcae_setting_page_title_bar_background_color', array( 'label' => __( 'Page Title Bar Background Color', 'keep-calm-and-ecomm' ), 'section' => 'colors', 'settings' => 'ewd_kcae_setting_page_title_bar_background_color' ) ) ); // PAGE TITLE BAR TEXT COLOR $wp_customize->add_setting( 'ewd_kcae_setting_page_title_bar_text_color', array( 'default' => '#fff', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_color_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ewd_kcae_setting_page_title_bar_text_color', array( 'label' => __( 'Page Title Bar Text Color', 'keep-calm-and-ecomm' ), 'section' => 'colors', 'settings' => 'ewd_kcae_setting_page_title_bar_text_color' ) ) ); /*============== END COLOURS ==============*/ /*============== START FONTS ==============*/ // CREATE FONTS SECTION $wp_customize->add_section( 'ewd_kcae_setting_fonts', array( 'title' => __( 'Fonts', 'keep-calm-and-ecomm'), 'description' => __( 'Please note that, if you use a Google font or other webfont, you must also properly include that font (i.e. in the header file, the functions file or via CSS).', 'keep-calm-and-ecomm'), 'priority' => 50 ) ); // MAIN BODY FONT $wp_customize->add_setting( 'ewd_kcae_setting_font_main', array( 'default' => '', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_text_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_font_main', array( 'section' => 'ewd_kcae_setting_fonts', 'label' => __( 'Main Body Font', 'keep-calm-and-ecomm' ), 'type' => 'text', ) ); // HEADING FONT $wp_customize->add_setting( 'ewd_kcae_setting_font_heading', array( 'default' => '', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_text_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_font_heading', array( 'section' => 'ewd_kcae_setting_fonts', 'label' => __( 'Heading Font', 'keep-calm-and-ecomm' ), 'type' => 'text', ) ); // MENU FONT $wp_customize->add_setting( 'ewd_kcae_setting_font_menu', array( 'default' => '', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_text_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_font_menu', array( 'section' => 'ewd_kcae_setting_fonts', 'label' => __( 'Menu Font', 'keep-calm-and-ecomm' ), 'type' => 'text', ) ); /*============== END FONTS ==============*/ /*============== START CALLOUT ==============*/ if($installedThemeCompanion){ // CREATE CALLOUT SECTION $wp_customize->add_section( 'ewd_kcae_setting_callout_section', array( 'title' => __( 'Callout Area', 'keep-calm-and-ecomm'), 'priority' => 200 ) ); // CALLOUT ENABLE $wp_customize->add_setting( 'ewd_kcae_setting_callout_enable', array( 'default' => 'yes', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_radio_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_callout_enable', array( 'section' => 'ewd_kcae_setting_callout_section', 'label' => __( 'Display Callout Area on Homepage', 'keep-calm-and-ecomm' ), 'type' => 'radio', 'choices' => array( 'yes' => __( 'Yes', 'keep-calm-and-ecomm' ), 'no' => __( 'No', 'keep-calm-and-ecomm' ), ) ) ); // CALLOUT HEADING TEXT $wp_customize->add_setting( 'ewd_kcae_setting_callout_heading_text', array( 'default' => '', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_text_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_callout_heading_text', array( 'section' => 'ewd_kcae_setting_callout_section', 'label' => __( 'Heading Text', 'keep-calm-and-ecomm' ), 'type' => 'text', ) ); // CALLOUT SUB-HEADING TEXT $wp_customize->add_setting( 'ewd_kcae_setting_callout_subheading_text', array( 'default' => '', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_text_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_callout_subheading_text', array( 'section' => 'ewd_kcae_setting_callout_section', 'label' => __( 'Sub-Heading Text', 'keep-calm-and-ecomm' ), 'type' => 'text', ) ); // CALLOUT BUTTON TEXT $wp_customize->add_setting( 'ewd_kcae_setting_callout_button_text', array( 'default' => '', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_text_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_callout_button_text', array( 'section' => 'ewd_kcae_setting_callout_section', 'label' => __( 'Button Text', 'keep-calm-and-ecomm' ), 'type' => 'text', ) ); // CALLOUT BUTTON LINK $wp_customize->add_setting( 'ewd_kcae_setting_callout_button_link', array( 'default' => '', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_url_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_callout_button_link', array( 'section' => 'ewd_kcae_setting_callout_section', 'label' => __( 'Button Link', 'keep-calm-and-ecomm' ), 'type' => 'text', ) ); // CALLOUT BACKGROUND COLOR $wp_customize->add_setting( 'ewd_kcae_setting_callout_background_color', array( 'default' => '#037751', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_color_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ewd_kcae_setting_callout_background_color', array( 'label' => __( 'Background Color', 'keep-calm-and-ecomm' ), 'section' => 'ewd_kcae_setting_callout_section', 'settings' => 'ewd_kcae_setting_callout_background_color' ) ) ); // CALLOUT TEXT COLOR $wp_customize->add_setting( 'ewd_kcae_setting_callout_text_color', array( 'default' => '#fff', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_color_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ewd_kcae_setting_callout_text_color', array( 'label' => __( 'Text Color', 'keep-calm-and-ecomm' ), 'section' => 'ewd_kcae_setting_callout_section', 'settings' => 'ewd_kcae_setting_callout_text_color' ) ) ); } //if theme companion active /*============== END CALLOUT ==============*/ /*============== START TEXT ON PIC ==============*/ if($installedThemeCompanion){ // CREATE TEXT ON PIC SECTION $wp_customize->add_section( 'ewd_kcae_setting_textonpic_section', array( 'title' => __( 'Text on Picture', 'keep-calm-and-ecomm'), 'priority' => 200 ) ); // TEXT ON PIC ENABLE $wp_customize->add_setting( 'ewd_kcae_setting_textonpic_enable', array( 'default' => 'yes', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_radio_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_textonpic_enable', array( 'section' => 'ewd_kcae_setting_textonpic_section', 'label' => __( 'Display Text-on-Picture Area on Homepage', 'keep-calm-and-ecomm' ), 'description' => __('Should the text overlay on a background image area be displayed?', 'keep-calm-and-ecomm'), 'type' => 'radio', 'choices' => array( 'yes' => __( 'Yes', 'keep-calm-and-ecomm' ), 'no' => __( 'No', 'keep-calm-and-ecomm' ), ) ) ); // TEXT ON PIC HEADING TEXT $wp_customize->add_setting( 'ewd_kcae_setting_textonpic_heading_text', array( 'default' => '', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_text_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_textonpic_heading_text', array( 'section' => 'ewd_kcae_setting_textonpic_section', 'label' => __( 'Heading Text', 'keep-calm-and-ecomm' ), 'type' => 'text', ) ); // TEXT ON PIC SUB-HEADING TEXT $wp_customize->add_setting( 'ewd_kcae_setting_textonpic_subheading_text', array( 'default' => '', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_text_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_textonpic_subheading_text', array( 'section' => 'ewd_kcae_setting_textonpic_section', 'label' => __( 'Sub-Heading Text', 'keep-calm-and-ecomm' ), 'type' => 'text', ) ); // TEXT ON PIC BUTTON TEXT $wp_customize->add_setting( 'ewd_kcae_setting_textonpic_button_text', array( 'default' => '', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_text_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_textonpic_button_text', array( 'section' => 'ewd_kcae_setting_textonpic_section', 'label' => __( 'Button Text', 'keep-calm-and-ecomm' ), 'type' => 'text', ) ); // TEXT ON PIC BUTTON LINK $wp_customize->add_setting( 'ewd_kcae_setting_textonpic_button_link', array( 'default' => '', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_url_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_textonpic_button_link', array( 'section' => 'ewd_kcae_setting_textonpic_section', 'label' => __( 'Button Link', 'keep-calm-and-ecomm' ), 'type' => 'text', ) ); // TEXT ON PIC TEXT COLOR $wp_customize->add_setting( 'ewd_kcae_setting_textonpic_text_color', array( 'default' => '#fff', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_color_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ewd_kcae_setting_textonpic_text_color', array( 'label' => __( 'Text Color', 'keep-calm-and-ecomm' ), 'section' => 'ewd_kcae_setting_textonpic_section', 'settings' => 'ewd_kcae_setting_textonpic_text_color' ) ) ); // TEXT ON PIC TEXT BACKGROUND IMAGE $wp_customize->add_setting( 'ewd_kcae_setting_textonpic_background_image', array( 'default' => '', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_url_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'ewd_kcae_setting_textonpic_background_image', array( 'label' => __( 'Background Image', 'keep-calm-and-ecomm' ), 'section' => 'ewd_kcae_setting_textonpic_section', 'settings' => 'ewd_kcae_setting_textonpic_background_image', ) ) ); // TEXT ON PIC TEXT OVERLAY IMAGE $wp_customize->add_setting( 'ewd_kcae_setting_textonpic_overlay_image', array( 'default' => '', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_url_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'ewd_kcae_setting_textonpic_overlay_image', array( 'label' => __( 'Overlay Image', 'keep-calm-and-ecomm' ), 'section' => 'ewd_kcae_setting_textonpic_section', 'settings' => 'ewd_kcae_setting_textonpic_overlay_image', ) ) ); } //if theme companion active /*============== END TEXT ON PIC ==============*/ /*============== START HOMEPAGE GENERAL ==============*/ if($installedThemeCompanion){ // CREATE HOMEPAGE GENERAL SECTION $wp_customize->add_section( 'ewd_kcae_setting_homepage_section', array( 'title' => __( 'Homepage Options', 'keep-calm-and-ecomm'), 'description' => __( 'The options to enable the Callout and Text-on-Picture areas can be found in the "Callout Area" and "Text on Picture" sections just below.', 'keep-calm-and-ecomm'), 'priority' => 199 ) ); // SLIDER ENABLE $wp_customize->add_setting( 'ewd_kcae_setting_homepage_slider_enable', array( 'default' => 'yes', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_radio_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_homepage_slider_enable', array( 'section' => 'ewd_kcae_setting_homepage_section', 'label' => __( 'Display Slider', 'keep-calm-and-ecomm' ), 'description' => __( 'Should the slider be displayed on the homepage?', 'keep-calm-and-ecomm' ), 'type' => 'radio', 'choices' => array( 'yes' => __( 'Yes', 'keep-calm-and-ecomm' ), 'no' => __( 'No', 'keep-calm-and-ecomm' ), ) ) ); // SLIDER STATIC FIRST SLIDE $wp_customize->add_setting( 'ewd_kcae_setting_homepage_slider_static_first', array( 'default' => 'no', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_radio_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_homepage_slider_static_first', array( 'section' => 'ewd_kcae_setting_homepage_section', 'label' => __( 'Display Static First Slide Only', 'keep-calm-and-ecomm' ), 'description' => __( 'Select this option to display your first slide as a static image, with no sliding or animation.', 'keep-calm-and-ecomm' ), 'type' => 'radio', 'choices' => array( 'yes' => __( 'Yes', 'keep-calm-and-ecomm' ), 'no' => __( 'No', 'keep-calm-and-ecomm' ), ) ) ); // JUMP BOXES ENABLE $wp_customize->add_setting( 'ewd_kcae_setting_homepage_jumpboxes_enable', array( 'default' => 'yes', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_radio_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_homepage_jumpboxes_enable', array( 'section' => 'ewd_kcae_setting_homepage_section', 'label' => __( 'Display Jump Boxes', 'keep-calm-and-ecomm' ), 'description' => __( 'Should the jump boxes be displayed on the homepage?', 'keep-calm-and-ecomm' ), 'type' => 'radio', 'choices' => array( 'yes' => __( 'Yes', 'keep-calm-and-ecomm' ), 'no' => __( 'No', 'keep-calm-and-ecomm' ), ) ) ); // TESTIMONIALS ENABLE $wp_customize->add_setting( 'ewd_kcae_setting_homepage_testimonials_enable', array( 'default' => 'yes', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_radio_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_homepage_testimonials_enable', array( 'section' => 'ewd_kcae_setting_homepage_section', 'label' => __( 'Display Testimonials', 'keep-calm-and-ecomm' ), 'description' => __( 'Should the testimonials be displayed on the homepage?', 'keep-calm-and-ecomm' ), 'type' => 'radio', 'choices' => array( 'yes' => __( 'Yes', 'keep-calm-and-ecomm' ), 'no' => __( 'No', 'keep-calm-and-ecomm' ), ) ) ); // FEATURED PRODUCTS ENABLE $wp_customize->add_setting( 'ewd_kcae_setting_homepage_featured_enable', array( 'default' => 'yes', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_radio_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_homepage_featured_enable', array( 'section' => 'ewd_kcae_setting_homepage_section', 'label' => __( 'Display Featured Products', 'keep-calm-and-ecomm' ), 'description' => __( 'Should featured products be displayed on the homepage?', 'keep-calm-and-ecomm' ), 'type' => 'radio', 'choices' => array( 'yes' => __( 'Yes', 'keep-calm-and-ecomm' ), 'no' => __( 'No', 'keep-calm-and-ecomm' ), ) ) ); } //if theme companion active /*============== END HOMEPAGE GENERAL ==============*/ /*============== START TRACKING PAGE URL ==============*/ if($installedOTP){ // CREATE TRACKING PAGE URL SECTION $wp_customize->add_section( 'ewd_kcae_setting_tracking_page_url', array( 'title' => __( 'Tracking Page URL', 'keep-calm-and-ecomm'), 'priority' => 1 ) ); // TRACKING PAGE URL TEXT $wp_customize->add_setting( 'ewd_kcae_setting_tracking_page_url_text', array( 'default' => '', 'sanitize_callback' => 'ewd_kcae_setting_sanitize_all_url_fields', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'ewd_kcae_setting_tracking_page_url_text', array( 'section' => 'ewd_kcae_setting_tracking_page_url', 'label' => __( 'Tracking Page URL', 'keep-calm-and-ecomm' ), 'description' => __( 'Input here the URL of the page on which you\'ve placed the [tracking-form] shortcode. This will ensure correct functionality of the features related to the Status Tracking plugin.', 'keep-calm-and-ecomm' ), 'type' => 'text', ) ); } //if is active OTP /*============== END TRACKING PAGE URL ==============*/ /*============== START IMPORTANT LINKS ==============*/ // DEFINE IMPORTANT LINKS class ewd_kcae_setting_important_links_class extends WP_Customize_Control { public $type = "ewd_kcae_setting_important_links_type"; public function render_content() { $important_links = array( 'view-pro' => array( 'link' => esc_url('http://www.etoilewebdesign.com/themes/keep-calm-and-ecomm/'), 'text' => esc_html__('View Premium Version', 'keep-calm-and-ecomm'), ), 'theme-info' => array( 'link' => esc_url('https://wordpress.org/themes/keep-calm-and-ecomm/'), 'text' => esc_html__('Theme Info', 'keep-calm-and-ecomm'), ), 'support' => array( 'link' => esc_url('https://wordpress.org/support/theme/keep-calm-and-ecomm/'), 'text' => esc_html__('Support Forum', 'keep-calm-and-ecomm'), ), /*'documentation' => array( 'link' => esc_url('https://wordpress.org/themes/keep-calm-and-ecomm/documentation/'), 'text' => esc_html__('Documentation', 'keep-calm-and-ecomm'), ),*/ 'demo' => array( 'link' => esc_url('http://www.etoilewebdesign.com/keep-calm-and-ecomm/'), 'text' => esc_html__('View Demo', 'keep-calm-and-ecomm'), ), 'rating' => array( 'link' => esc_url('http://wordpress.org/support/view/theme-reviews/keep-calm-and-ecomm'), 'text' => esc_html__('Leave a Review', 'keep-calm-and-ecomm'), ), 'feedback' => array( 'link' => esc_url('mailto:contact@etoilewebdesign.com'), 'text' => esc_html__('Send Us Feedback', 'keep-calm-and-ecomm'), ), ); foreach ( $important_links as $important_link ) { echo '

' . esc_attr( $important_link['text'] ) . '

'; } } } // CREATE IMPORTANT SECTION $wp_customize->add_section( 'ewd_kcae_setting_important_links_section', array( 'title' => __( 'Keep Calm Important Links', 'keep-calm-and-ecomm'), 'priority' => 1000 ) ); // DISPLAY IMPORTANT LINKS $wp_customize->add_setting( 'ewd_kcae_setting_important_links', array( 'sanitize_callback' => 'ewd_kcae_setting_sanitize_false', ) ); $wp_customize->add_control( new ewd_kcae_setting_important_links_class( $wp_customize, 'important_links', array( 'section' => 'ewd_kcae_setting_important_links_section', 'settings' => 'ewd_kcae_setting_important_links' ) ) ); // IMPORTANT LINKS CSS add_action( 'customize_controls_print_footer_scripts', 'ewd_kcae_setting_important_links_css' ); function ewd_kcae_setting_important_links_css() { ?> "; $usCustomizerCSS = ""; $usCustomizerCSS .= "body { color: " . get_theme_mod( 'ewd_kcae_setting_text_color' ) . "; }"; $usCustomizerCSS .= "a { color: " . get_theme_mod( 'ewd_kcae_setting_link_color' ) . "; }"; $usCustomizerCSS .= "#header { background: " . get_theme_mod( 'ewd_kcae_setting_header_background_color' ) . "; }"; $usCustomizerCSS .= "#menu ul li a { color: " . get_theme_mod( 'ewd_kcae_setting_menu_text_color' ) . "; }"; $usCustomizerCSS .= "#menu ul li a:hover { color: " . get_theme_mod( 'ewd_kcae_setting_menu_text_hover_color' ) . "; border-bottom-color: " . get_theme_mod( 'ewd_kcae_setting_menu_text_hover_color' ) . "; }"; $usCustomizerCSS .= "#header input:hover { background: " . get_theme_mod( 'ewd_kcae_setting_menu_text_hover_color' ) . "; border-color: " . get_theme_mod( 'ewd_kcae_setting_menu_text_hover_color' ) . "; }"; $usCustomizerCSS .= "#menu ul li ul { background: " . get_theme_mod( 'ewd_kcae_setting_menu_dropdown_background_color' ) . "; }"; $usCustomizerCSS .= "/*#menu ul li ul { border-color: " . get_theme_mod( 'ewd_kcae_setting_menu_dropdown_background_color' ) . "; }*/"; $usCustomizerCSS .= "#menu ul li ul li a:hover { background: " . get_theme_mod( 'ewd_kcae_setting_menu_dropdown_background_hover_color' ) . "; }"; $usCustomizerCSS .= "#menu ul li ul li a { color: " . get_theme_mod( 'ewd_kcae_setting_menu_dropdown_text_color' ) . "; }"; $usCustomizerCSS .= "#menu ul li ul li a:hover { color: " . get_theme_mod( 'ewd_kcae_setting_menu_dropdown_text_hover_color' ) . "; }"; $usCustomizerCSS .= "#logo { height: " . get_theme_mod( 'ewd_kcae_setting_logo_height', '24px' ) . "; margin-top: " . get_theme_mod( 'ewd_kcae_setting_logo_top_margin', '28px' ) . "; }"; $usCustomizerCSS .= ".singlePage .titleArea { background-color: " . get_theme_mod( 'ewd_kcae_setting_page_title_bar_background_color' ) . "; }"; $usCustomizerCSS .= ".singlePage .titleArea h1 { color: " . get_theme_mod( 'ewd_kcae_setting_page_title_bar_text_color' ) . "; }"; if($fontMain != ''){ $usCustomizerCSS .= "body { font-family: " . $fontMain . "; }"; } if($fontHeadings != ''){ $usCustomizerCSS .= "h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { font-family: " . $fontHeadings . "; }"; } if($fontMenu != ''){ $usCustomizerCSS .= "#menu ul li a, #header input { font-family: " . $fontMenu . "; }"; } echo esc_attr($usCustomizerCSS); echo ""; } add_action( 'wp_head', 'ewd_kcae_customizer_css' ); function ewd_kcae_setting_sanitize_all_text_fields($input){ return sanitize_text_field($input); } function ewd_kcae_setting_sanitize_all_textarea_fields($input){ return sanitize_textarea_field($input); } function ewd_kcae_setting_sanitize_all_color_fields($input){ return sanitize_hex_color($input); } function ewd_kcae_setting_sanitize_all_url_fields($input){ return esc_url_raw($input); } function ewd_kcae_setting_sanitize_all_radio_fields($input, $setting){ $input = sanitize_key($input); $choices = $setting->manager->get_control($setting->id)->choices; return ( array_key_exists($input, $choices) ? $input : $setting->default ); } function ewd_kcae_setting_sanitize_false(){ return false; } /* ===================================================================== Excerpt Read More link ===================================================================== */ function ewd_kcae_excerpt_read_more($more) { global $post; return '
' . __('Read More', 'keep-calm-and-ecomm') . ''; } add_filter('excerpt_more', 'ewd_kcae_excerpt_read_more'); /* ===================================================================== WooCommerce ===================================================================== */ //Declare support add_action( 'after_setup_theme', 'ewd_kcae_woocommerce_support' ); function ewd_kcae_woocommerce_support() { add_theme_support( 'woocommerce' ); }