get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; wp_enqueue_style('astronomy-store-customize-controls', trailingslashit(esc_url(get_template_directory_uri())).'/css/customize-controls.css'); // color site title $wp_customize->add_setting('astronomy_store_sitetitle_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_sitetitle_color', array( 'settings' => 'astronomy_store_sitetitle_color', 'section' => 'title_tagline', 'label' => __('Site Title Color', 'astronomy-store'), 'type' => 'color' )); $wp_customize->add_setting('astronomy_store_title_enable',array( 'default' => true, 'sanitize_callback' => 'astronomy_store_sanitize_checkbox', )); $wp_customize->add_control( 'astronomy_store_title_enable', array( 'settings' => 'astronomy_store_title_enable', 'section' => 'title_tagline', 'label' => __('Enable Site Title','astronomy-store'), 'type' => 'checkbox' )); // color site tagline $wp_customize->add_setting('astronomy_store_sitetagline_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_sitetagline_color', array( 'settings' => 'astronomy_store_sitetagline_color', 'section' => 'title_tagline', 'label' => __('Site Tagline Color', 'astronomy-store'), 'type' => 'color' )); $wp_customize->add_setting('astronomy_store_tagline_enable',array( 'default' => false, 'sanitize_callback' => 'astronomy_store_sanitize_checkbox', )); $wp_customize->add_control( 'astronomy_store_tagline_enable', array( 'settings' => 'astronomy_store_tagline_enable', 'section' => 'title_tagline', 'label' => __('Enable Site Tagline','astronomy-store'), 'type' => 'checkbox' )); //Theme Options $wp_customize->add_panel( 'astronomy_store_panel_area', array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __( 'Theme Options Panel', 'astronomy-store' ), ) ); // Header Section $wp_customize->add_section('astronomy_store_header_section', array( 'title' => __('Manage Header Section', 'astronomy-store'), 'description' => __('
Manage Header Section
','astronomy-store'), 'priority' => null, 'panel' => 'astronomy_store_panel_area', )); $wp_customize->add_setting('astronomy_store_stickyheader',array( 'default' => false, 'sanitize_callback' => 'astronomy_store_sanitize_checkbox', )); $wp_customize->add_control( 'astronomy_store_stickyheader', array( 'section' => 'astronomy_store_header_section', 'label' => __('Check To Show Sticky Header','astronomy-store'), 'type' => 'checkbox' )); $wp_customize->add_setting('astronomy_store_fb_link',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_fb_link', array( 'settings' => 'astronomy_store_fb_link', 'section' => 'astronomy_store_header_section', 'label' => __('Facebook Link', 'astronomy-store'), 'type' => 'url' )); // color facebook $wp_customize->add_setting('astronomy_store_fb_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_fb_color', array( 'settings' => 'astronomy_store_fb_color', 'section' => 'astronomy_store_header_section', 'label' => __('Facebook Color', 'astronomy-store'), 'type' => 'color' )); $wp_customize->add_setting('astronomy_store_twitt_link',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_twitt_link', array( 'settings' => 'astronomy_store_twitt_link', 'section' => 'astronomy_store_header_section', 'label' => __('Twitter Link', 'astronomy-store'), 'type' => 'url' )); // color twitt $wp_customize->add_setting('astronomy_store_twitt_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_twitt_color', array( 'settings' => 'astronomy_store_twitt_color', 'section' => 'astronomy_store_header_section', 'label' => __('Twitter Color', 'astronomy-store'), 'type' => 'color' )); $wp_customize->add_setting('astronomy_store_pinterst_link',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_pinterst_link', array( 'settings' => 'astronomy_store_pinterst_link', 'section' => 'astronomy_store_header_section', 'label' => __('Pinterest Link', 'astronomy-store'), 'type' => 'url' )); // color pinterest $wp_customize->add_setting('astronomy_store_pinterst_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_pinterst_color', array( 'settings' => 'astronomy_store_pinterst_color', 'section' => 'astronomy_store_header_section', 'label' => __('Pinterst Color', 'astronomy-store'), 'type' => 'color' )); $wp_customize->add_setting('astronomy_store_insta_link',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_insta_link', array( 'settings' => 'astronomy_store_insta_link', 'section' => 'astronomy_store_header_section', 'label' => __('Instagram Link', 'astronomy-store'), 'type' => 'url' )); // color insta $wp_customize->add_setting('astronomy_store_insta_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_insta_color', array( 'settings' => 'astronomy_store_insta_color', 'section' => 'astronomy_store_header_section', 'label' => __('Instagram Color', 'astronomy-store'), 'type' => 'color' )); // header menu $wp_customize->add_setting('astronomy_store_menu_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_menu_color', array( 'settings' => 'astronomy_store_menu_color', 'section' => 'astronomy_store_header_section', 'label' => __('Menu Color', 'astronomy-store'), 'type' => 'color' )); // header menu hover color $wp_customize->add_setting('astronomy_store_menuhrv_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_menuhrv_color', array( 'settings' => 'astronomy_store_menuhrv_color', 'section' => 'astronomy_store_header_section', 'label' => __('Menu Hover Color', 'astronomy-store'), 'type' => 'color' )); // header sub menu color $wp_customize->add_setting('astronomy_store_submenu_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_submenu_color', array( 'settings' => 'astronomy_store_submenu_color', 'section' => 'astronomy_store_header_section', 'label' => __('SubMenu Color', 'astronomy-store'), 'type' => 'color' )); // header sub menu bg color $wp_customize->add_setting('astronomy_store_submenubg_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_submenubg_color', array( 'settings' => 'astronomy_store_submenubg_color', 'section' => 'astronomy_store_header_section', 'label' => __('SubMenu BG Color', 'astronomy-store'), 'type' => 'color' )); // header sub menu hover color $wp_customize->add_setting('astronomy_store_submenuhrv_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_submenuhrv_color', array( 'settings' => 'astronomy_store_submenuhrv_color', 'section' => 'astronomy_store_header_section', 'label' => __('SubMenu Hover Color', 'astronomy-store'), 'type' => 'color' )); // header sub menu border color $wp_customize->add_setting('astronomy_store_submenuborder_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_submenuborder_color', array( 'settings' => 'astronomy_store_submenuborder_color', 'section' => 'astronomy_store_header_section', 'label' => __('SubMenu Border Color', 'astronomy-store'), 'type' => 'color' )); // Home Category Dropdown Section $wp_customize->add_section('astronomy_store_one_cols_section',array( 'title' => __('Manage Slider Section','astronomy-store'), 'description' => __('Manage Slider Section
Select Category from the Dropdowns for slider, Also use the given image dimension (1600 x 850).','astronomy-store'), 'priority' => null, 'panel' => 'astronomy_store_panel_area' )); // Add a category dropdown Slider Coloumn $wp_customize->add_setting( 'astronomy_store_slidersection', array( 'default' => '0', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( new Astronomy_Store_Category_Dropdown_Custom_Control( $wp_customize, 'astronomy_store_slidersection', array( 'section' => 'astronomy_store_one_cols_section', 'settings' => 'astronomy_store_slidersection', ) ) ); //Hide Section $wp_customize->add_setting('astronomy_store_hide_categorysec',array( 'default' => false, 'sanitize_callback' => 'astronomy_store_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_hide_categorysec', array( 'settings' => 'astronomy_store_hide_categorysec', 'section' => 'astronomy_store_one_cols_section', 'label' => __('Check To Enable This Section','astronomy-store'), 'type' => 'checkbox' )); $wp_customize->add_setting('astronomy_store_button_text',array( 'default' => 'Read More', 'sanitize_callback' => 'sanitize_text_field', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_button_text', array( 'settings' => 'astronomy_store_button_text', 'section' => 'astronomy_store_one_cols_section', 'label' => __('Add Button Text', 'astronomy-store'), 'type' => 'text' )); $wp_customize->add_setting('astronomy_store_button2_text',array( 'default' => 'Contact Us', 'sanitize_callback' => 'sanitize_text_field', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_button2_text', array( 'settings' => 'astronomy_store_button2_text', 'section' => 'astronomy_store_one_cols_section', 'label' => __('Add Button 2 Text', 'astronomy-store'), 'type' => 'text' )); $wp_customize->add_setting('astronomy_store_button2_url',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_button2_url', array( 'settings' => 'astronomy_store_button2_url', 'section' => 'astronomy_store_one_cols_section', 'label' => __('Add Button 2 URL', 'astronomy-store'), 'type' => 'url' )); // color slider title $wp_customize->add_setting('astronomy_store_slidertitle_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_slidertitle_color', array( 'settings' => 'astronomy_store_slidertitle_color', 'section' => 'astronomy_store_one_cols_section', 'label' => __('Title Color', 'astronomy-store'), 'type' => 'color' )); // color slider description $wp_customize->add_setting('astronomy_store_sliderdescription_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_sliderdescription_color', array( 'settings' => 'astronomy_store_sliderdescription_color', 'section' => 'astronomy_store_one_cols_section', 'label' => __('Description Color', 'astronomy-store'), 'type' => 'color' )); // color slider button1 text $wp_customize->add_setting('astronomy_store_sliderbutton1text_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_sliderbutton1text_color', array( 'settings' => 'astronomy_store_sliderbutton1text_color', 'section' => 'astronomy_store_one_cols_section', 'label' => __('Button 1 Text Color', 'astronomy-store'), 'type' => 'color' )); // color slider button1 $wp_customize->add_setting('astronomy_store_sliderbutton1_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_sliderbutton1_color', array( 'settings' => 'astronomy_store_sliderbutton1_color', 'section' => 'astronomy_store_one_cols_section', 'label' => __('Button 1 Color', 'astronomy-store'), 'type' => 'color' )); // color slider button2 text $wp_customize->add_setting('astronomy_store_sliderbutton2text_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_sliderbutton2text_color', array( 'settings' => 'astronomy_store_sliderbutton2text_color', 'section' => 'astronomy_store_one_cols_section', 'label' => __('Button 2 Text Color', 'astronomy-store'), 'type' => 'color' )); // color slider button2 $wp_customize->add_setting('astronomy_store_sliderbutton2_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_sliderbutton2_color', array( 'settings' => 'astronomy_store_sliderbutton2_color', 'section' => 'astronomy_store_one_cols_section', 'label' => __('Button 2 Color', 'astronomy-store'), 'type' => 'color' )); // Services Section $wp_customize->add_section('astronomy_store_below_slider_section', array( 'title' => __('Manage Services Section','astronomy-store'), 'description' => __('Manage Services Section
Select Pages from the dropdown for Services.','astronomy-store'), 'priority' => null, 'panel' => 'astronomy_store_panel_area', )); // Add a category dropdown Slider Coloumn $wp_customize->add_setting( 'astronomy_store_services_cat', array( 'default' => '0', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( new Astronomy_Store_Category_Dropdown_Custom_Control( $wp_customize, 'astronomy_store_services_cat', array( 'section' => 'astronomy_store_below_slider_section', 'settings' => 'astronomy_store_services_cat', ) ) ); $wp_customize->add_setting('astronomy_store_disabled_pgboxes',array( 'default' => false, 'sanitize_callback' => 'astronomy_store_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_disabled_pgboxes', array( 'settings' => 'astronomy_store_disabled_pgboxes', 'section' => 'astronomy_store_below_slider_section', 'label' => __('Check To Enable This Section','astronomy-store'), 'type' => 'checkbox' )); $wp_customize->add_setting('astronomy_store_service_heading',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_service_heading', array( 'settings' => 'astronomy_store_service_heading', 'section' => 'astronomy_store_below_slider_section', 'label' => __('Heading', 'astronomy-store'), 'type' => 'text' )); // service heading color $wp_customize->add_setting('astronomy_store_serviceheading_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_serviceheading_color', array( 'settings' => 'astronomy_store_serviceheading_color', 'section' => 'astronomy_store_below_slider_section', 'label' => __('Heading Color', 'astronomy-store'), 'type' => 'color' )); $wp_customize->add_setting('astronomy_store_service_subheading',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_service_subheading', array( 'settings' => 'astronomy_store_service_subheading', 'section' => 'astronomy_store_below_slider_section', 'label' => __('Sub Heading', 'astronomy-store'), 'type' => 'text' )); // service subheading color $wp_customize->add_setting('astronomy_store_servicesubheading_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_servicesubheading_color', array( 'settings' => 'astronomy_store_servicesubheading_color', 'section' => 'astronomy_store_below_slider_section', 'label' => __('SubHeading Color', 'astronomy-store'), 'type' => 'color' )); // service title color $wp_customize->add_setting('astronomy_store_servicetitle_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_servicetitle_color', array( 'settings' => 'astronomy_store_servicetitle_color', 'section' => 'astronomy_store_below_slider_section', 'label' => __('Title Color', 'astronomy-store'), 'type' => 'color' )); // Footer Section $wp_customize->add_section('astronomy_store_footer', array( 'title' => __('Manage Footer Section','astronomy-store'), 'description' => __('Manage Footer Section
','astronomy-store'), 'priority' => null, 'panel' => 'astronomy_store_panel_area', )); $wp_customize->add_setting('astronomy_store_copyright_line',array( 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control( 'astronomy_store_copyright_line', array( 'section' => 'astronomy_store_footer', 'label' => __('Copyright Line','astronomy-store'), 'type' => 'text', 'priority' => null, )); $wp_customize->add_setting('astronomy_store_copyright_link',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control( 'astronomy_store_copyright_link', array( 'section' => 'astronomy_store_footer', 'label' => __('Copyright Link','astronomy-store'), 'type' => 'text', 'priority' => null, )); // footer coypright color $wp_customize->add_setting('astronomy_store_footercoypright_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_footercoypright_color', array( 'settings' => 'astronomy_store_footercoypright_color', 'section' => 'astronomy_store_footer', 'label' => __('Coypright Color', 'astronomy-store'), 'type' => 'color' )); // footer bg color $wp_customize->add_setting('astronomy_store_footerbg_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_footerbg_color', array( 'settings' => 'astronomy_store_footerbg_color', 'section' => 'astronomy_store_footer', 'label' => __('BG Color', 'astronomy-store'), 'type' => 'color' )); // footer title color $wp_customize->add_setting('astronomy_store_footertitle_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_footertitle_color', array( 'settings' => 'astronomy_store_footertitle_color', 'section' => 'astronomy_store_footer', 'label' => __('Title Color', 'astronomy-store'), 'type' => 'color' )); // footer description color $wp_customize->add_setting('astronomy_store_footerdescription_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_footerdescription_color', array( 'settings' => 'astronomy_store_footerdescription_color', 'section' => 'astronomy_store_footer', 'label' => __('Description Color', 'astronomy-store'), 'type' => 'color' )); // footer list color $wp_customize->add_setting('astronomy_store_footerlist_color',array( 'default' => '', 'sanitize_callback' => 'astronomy_store_sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'astronomy_store_footerlist_color', array( 'settings' => 'astronomy_store_footerlist_color', 'section' => 'astronomy_store_footer', 'label' => __('List Color', 'astronomy-store'), 'type' => 'color' )); $wp_customize->add_setting('astronomy_store_scroll_hide', array( 'default' => false, 'sanitize_callback' => 'astronomy_store_sanitize_checkbox' )); $wp_customize->add_control( new WP_Customize_Control($wp_customize,'astronomy_store_scroll_hide',array( 'label' => __( 'Check To Show Scroll To Top', 'astronomy-store' ), 'section' => 'astronomy_store_footer', 'settings' => 'astronomy_store_scroll_hide', 'type' => 'checkbox', ))); } add_action( 'customize_register', 'astronomy_store_customize_register' ); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function astronomy_store_customize_preview_js() { wp_enqueue_script( 'astronomy_store_customizer', esc_url(get_template_directory_uri()) . '/js/customize-preview.js', array( 'customize-preview' ), '20161510', true ); } add_action( 'customize_preview_init', 'astronomy_store_customize_preview_js' );