get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; global $fontawesome_choices, $wp_registered_sidebars; $hashone_widget_list[] = "-- Don't Replace --"; foreach ($wp_registered_sidebars as $wp_registered_sidebar) { $hashone_widget_list[$wp_registered_sidebar['id']] = $wp_registered_sidebar['name']; } $hashone_categories = get_categories(array('hide_empty' => 0)); $hashone_pages = get_pages(array('hide_empty' => 0)); foreach ($hashone_pages as $hashone_pages_single) { $hashone_page_choice[$hashone_pages_single->ID] = $hashone_pages_single->post_title; } for ( $i = 1; $i <= 100 ; $i++) { $hashone_percentage[] = $i; } for ( $i = 1; $i <= 10 ; $i++) { $hashone_post_count_choice[] = $i; } foreach ($hashone_categories as $hashone_category) { $hash_cat[$hashone_category->term_id] = $hashone_category->cat_name; } /*============GENERAL SETTINGS PANEL============*/ $wp_customize->add_panel( 'hashone_general_settings_panel', array( 'title' => __( 'General Settings', 'hashone' ), 'priority' => 10 ) ); //STATIC FRONT PAGE $wp_customize->add_section( 'static_front_page', array( 'title' => __( 'Static Front Page', 'hashone' ), 'panel' => 'hashone_general_settings_panel', 'description' => __( 'Your theme supports a static front page.', 'hashone'), ) ); //TITLE AND TAGLINE SETTINGS $wp_customize->add_section( 'title_tagline', array( 'title' => __( 'Site Title & Tagline', 'hashone' ), 'panel' => 'hashone_general_settings_panel', ) ); //HEADER LOGO $wp_customize->add_section( 'header_image', array( 'title' => __( 'Header Logo', 'hashone' ), 'panel' => 'hashone_general_settings_panel', ) ); //BACKGROUND IMAGE $wp_customize->add_section( 'background_image', array( 'title' => __( 'Background Image', 'hashone' ), 'panel' => 'hashone_general_settings_panel', ) ); //COLOR SETTINGS /* $wp_customize->add_section( 'colors', array( 'title' => __( 'Colors' , 'hashone'), 'panel' => 'hashone_general_settings_panel', ) ); $wp_customize->add_setting( 'hashone_theme_color', array( 'default' => 'red', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( 'hashone_theme_color', array( 'settings' => 'hashone_theme_color', 'section' => 'colors', 'type' => 'radio', 'label' => __( 'Theme Color', 'hashone' ), 'choices' => array( 'red' => __( 'Red' , 'hashone' ), 'green' => __( 'Green' , 'hashone' ), 'blue' => __( 'Blue' , 'hashone' ) ) ) ); */ /*============SLIDER IMAGES PANEL============*/ $wp_customize->add_panel( 'hashone_slider_panel', array( 'title' => __( 'Home Slider Section', 'hashone' ), 'priority' => 11 ) ); //SLIDERS for ($i=1; $i < 4; $i++) { $wp_customize->add_section( 'hashone_slider'.$i, array( 'title' => __( 'Slider ', 'hashone' ).$i, 'panel' => 'hashone_slider_panel' ) ); $wp_customize->add_setting( 'hashone_slider_title'.$i, array( 'default' => 'Header '.$i, 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_slider_title'.$i, array( 'settings' => 'hashone_slider_title'.$i, 'section' => 'hashone_slider'.$i, 'type' => 'text', 'label' => __( 'Caption Title', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_slider_subtitle'.$i, array( 'default' => 'Header '.$i, 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_slider_subtitle'.$i, array( 'settings' => 'hashone_slider_subtitle'.$i, 'section' => 'hashone_slider'.$i, 'type' => 'textarea', 'label' => __( 'Caption SubTitle', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_slider_image'.$i, array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'hashone_slider_image'.$i, array( 'label' => __( 'Slider Image', 'hashone' ), 'settings' => 'hashone_slider_image'.$i, 'section' => 'hashone_slider'.$i, 'description' => __( 'Image Size: 1900X600px', 'hashone' ) ) ) ); } /*============ABOUT US PANEL============*/ $wp_customize->add_panel( 'hashone_about_panel', array( 'title' => __( 'About Us Section', 'hashone' ), 'priority' => 12 ) ); //BACKGROUND IMAGE $wp_customize->add_section( 'hashone_about_bg_sec', array( 'title' => __( 'Section Background', 'hashone' ), 'panel' => 'hashone_about_panel' ) ); //ABOUT US PAGE $wp_customize->add_section( 'hashone_about_page_sec', array( 'title' => __( 'About Us Page', 'hashone' ), 'panel' => 'hashone_about_panel' ) ); $wp_customize->add_setting( 'hashone_about_page', array( 'default' => '', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( 'hashone_about_page', array( 'settings' => 'hashone_about_page', 'section' => 'hashone_about_page_sec', 'type' => 'dropdown-pages', 'label' => __( 'Select a Page', 'hashone' ), ) ); //ABOUT US PROGRESS BAR $wp_customize->add_section( 'hashone_about_progressbar_sec', array( 'title' => __( 'About Us Progress Bar', 'hashone' ), 'panel' => 'hashone_about_panel' ) ); $wp_customize->add_setting( 'hashone_about_widget', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_choices' ) ); $wp_customize->add_control( 'hashone_about_widget', array( 'settings' => 'hashone_about_widget', 'section' => 'hashone_about_progressbar_sec', 'type' => 'select', 'label' => __( 'Replace Progress Bar by widget', 'hashone' ), 'choices' => $hashone_widget_list ) ); for ($i=1; $i < 6; $i++) { $wp_customize->add_setting( 'hashone_about_progressbar_heading'.$i, array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( new Hashone_Customize_Heading( $wp_customize, 'hashone_about_progressbar_heading'.$i, array( 'settings' => 'hashone_about_progressbar_heading'.$i, 'section' => 'hashone_about_progressbar_sec', 'label' => __( 'Progress Bar ', 'hashone' ).$i, ) ) ); $wp_customize->add_setting( 'hashone_about_progressbar_title'.$i, array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_about_progressbar_title'.$i, array( 'settings' => 'hashone_about_progressbar_title'.$i, 'section' => 'hashone_about_progressbar_sec', 'type' => 'text', 'label' => __( 'Title', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_about_progressbar_percentage'.$i, array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_choices' ) ); $wp_customize->add_control( new Hashone_Dropdown_Chooser( $wp_customize, 'hashone_about_progressbar_percentage'.$i, array( 'settings' => 'hashone_about_progressbar_percentage'.$i, 'section' => 'hashone_about_progressbar_sec', 'label' => __( 'Percentage', 'hashone' ), 'choices' => $hashone_percentage ) ) ); } /*============FEATURED SECTION PANEL============*/ $wp_customize->add_panel( 'hashone_featured_panel', array( 'title' => __( 'Featured Section', 'hashone' ), 'priority' => 13 ) ); $wp_customize->add_section( 'hashone_featured_title_sec', array( 'title' => __( 'Section Title & Desc', 'hashone' ), 'panel' => 'hashone_featured_panel' ) ); $wp_customize->add_setting( 'hashone_featured_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_featured_title', array( 'settings' => 'hashone_featured_title', 'section' => 'hashone_featured_title_sec', 'type' => 'text', 'label' => __( 'Title', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_featured_desc', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_featured_desc', array( 'settings' => 'hashone_featured_desc', 'section' => 'hashone_featured_title_sec', 'type' => 'textarea', 'label' => __( 'Description', 'hashone' ) ) ); //FEATURED PAGES $wp_customize->add_section( 'hashone_featured_page_sec', array( 'title' => __( 'Featured Posts', 'hashone' ), 'panel' => 'hashone_featured_panel' ) ); for( $i = 1; $i < 5; $i++ ){ $wp_customize->add_setting( 'hashone_featured_header'.$i, array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( new Hashone_Customize_Heading( $wp_customize, 'hashone_featured_header'.$i, array( 'settings' => 'hashone_featured_header'.$i, 'section' => 'hashone_featured_page_sec', 'label' => __( 'Featured Page ', 'hashone' ).$i ) ) ); $wp_customize->add_setting( 'hashone_featured_page'.$i, array( 'default' => '', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( 'hashone_featured_page'.$i, array( 'settings' => 'hashone_featured_page'.$i, 'section' => 'hashone_featured_page_sec', 'type' => 'dropdown-pages', 'label' => __( 'Select a Page', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_featured_page_icon'.$i, array( 'default' => 'fa-bell', 'sanitize_callback' => 'hashone_sanitize_choices' ) ); $wp_customize->add_control( new Hashone_Dropdown_Chooser( $wp_customize, 'hashone_featured_page_icon'.$i, array( 'settings' => 'hashone_featured_page_icon'.$i, 'section' => 'hashone_featured_page_sec', 'type' => 'select', 'label' => __( 'FontAwesome Icon', 'hashone' ), 'choices' => $fontawesome_choices, ) ) ); } /*============PORTFOLIO SECTION PANEL============*/ $wp_customize->add_panel( 'hashone_portfolio_panel', array( 'title' => __( 'Portfolio Section', 'hashone' ), 'priority' => 14 ) ); $wp_customize->add_section( 'hashone_portfolio_title_sec', array( 'title' => __( 'Portfolio Title', 'hashone' ), 'panel' => 'hashone_portfolio_panel' ) ); $wp_customize->add_setting( 'hashone_portfolio_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_portfolio_title', array( 'settings' => 'hashone_portfolio_title', 'section' => 'hashone_portfolio_title_sec', 'type' => 'text', 'label' => __( 'Title', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_portfolio_sub_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_portfolio_sub_title', array( 'settings' => 'hashone_portfolio_sub_title', 'section' => 'hashone_portfolio_title_sec', 'type' => 'textarea', 'label' => __( 'Sub Title', 'hashone' ) ) ); //PORTFOLIO CHOICES $wp_customize->add_section( 'hashone_portfolio_section_cat', array( 'title' => __( 'Portfolio Category', 'hashone' ), 'panel' => 'hashone_portfolio_panel' ) ); $wp_customize->add_setting( 'hashone_portfolio_cat', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_choices' ) ); $wp_customize->add_control( new Hashone_Customize_Checkbox_Multiple( $wp_customize, 'hashone_portfolio_cat', array( 'label' => 'Select Category', 'section' => 'hashone_portfolio_section_cat', 'settings' => 'hashone_portfolio_cat', 'choices' => $hash_cat ) ) ); /*============SERVICE SECTION PANEL============*/ $wp_customize->add_panel( 'hashone_service_panel', array( 'title' => __( 'Service Section', 'hashone' ), 'priority' => 15 ) ); $wp_customize->add_section( 'hashone_service_title_sec', array( 'title' => __( 'Section Title', 'hashone' ), 'panel' => 'hashone_service_panel' ) ); $wp_customize->add_setting( 'hashone_service_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_service_title', array( 'settings' => 'hashone_service_title', 'section' => 'hashone_service_title_sec', 'type' => 'text', 'label' => __( 'Title', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_service_sub_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_featured_sub_title', array( 'settings' => 'hashone_service_sub_title', 'section' => 'hashone_service_title_sec', 'type' => 'textarea', 'label' => __( 'Sub Title', 'hashone' ) ) ); //SERVICE PAGES $wp_customize->add_section( 'hashone_service_page_sec', array( 'title' => __( 'Service Posts', 'hashone' ), 'panel' => 'hashone_service_panel' ) ); $wp_customize->add_setting( 'hashone_service_left_bg', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'hashone_service_left_bg', array( 'label' => 'Left Image', 'section' => 'hashone_service_page_sec', 'settings' => 'hashone_service_left_bg' ) ) ); for( $i = 1; $i < 7; $i++ ){ $wp_customize->add_setting( 'hashone_service_header'.$i, array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( new Hashone_Customize_Heading( $wp_customize, 'hashone_service_header'.$i, array( 'settings' => 'hashone_service_header'.$i, 'section' => 'hashone_service_page_sec', 'label' => __( 'Service Page ', 'hashone' ).$i ) ) ); $wp_customize->add_setting( 'hashone_service_page'.$i, array( 'default' => '', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( 'hashone_service_page'.$i, array( 'settings' => 'hashone_service_page'.$i, 'section' => 'hashone_service_page_sec', 'type' => 'dropdown-pages', 'label' => __( 'Select a Page', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_service_page_icon'.$i, array( 'default' => 'fa-bell', 'sanitize_callback' => 'hashone_sanitize_choices' ) ); $wp_customize->add_control( new Hashone_Dropdown_Chooser( $wp_customize, 'hashone_service_page_icon'.$i, array( 'settings' => 'hashone_service_page_icon'.$i, 'section' => 'hashone_service_page_sec', 'choices' => $fontawesome_choices, 'label' => __( 'FontAwesome Icon', 'hashone' ) ) ) ); } /*============TEAM SECTION PANEL============*/ $wp_customize->add_panel( 'hashone_team_panel', array( 'title' => __( 'Team Section', 'hashone' ), 'priority' => 16 ) ); $wp_customize->add_section( 'hashone_team_title_sec', array( 'title' => __( 'Section Title', 'hashone' ), 'panel' => 'hashone_team_panel' ) ); $wp_customize->add_setting( 'hashone_team_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_team_title', array( 'settings' => 'hashone_team_title', 'section' => 'hashone_team_title_sec', 'type' => 'text', 'label' => __( 'Title', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_team_sub_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_team_sub_title', array( 'settings' => 'hashone_team_sub_title', 'section' => 'hashone_team_title_sec', 'type' => 'textarea', 'label' => __( 'Sub Title', 'hashone' ) ) ); //TEAM PAGES for( $i = 1; $i < 5; $i++ ){ $wp_customize->add_section( 'hashone_team_section'.$i, array( 'title' => __( 'Team Post ', 'hashone' ).$i, 'panel' => 'hashone_team_panel' ) ); $wp_customize->add_setting( 'hashone_team_page'.$i, array( 'default' => '', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( 'hashone_team_page'.$i, array( 'settings' => 'hashone_team_page'.$i, 'section' => 'hashone_team_section'.$i, 'type' => 'dropdown-pages', 'label' => __( 'Select a Page', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_team_designation'.$i, array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_team_designation'.$i, array( 'settings' => 'hashone_team_designation'.$i, 'section' => 'hashone_team_section'.$i, 'type' => 'text', 'label' => __( 'Team Member Designation', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_team_facebook'.$i, array( 'default' => 'https://facebook.com', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'hashone_team_facebook'.$i, array( 'settings' => 'hashone_team_facebook'.$i, 'section' => 'hashone_team_section'.$i, 'type' => 'url', 'label' => __( 'Facebook Url', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_team_twitter'.$i, array( 'default' => 'https://twitter.com', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'hashone_team_twitter'.$i, array( 'settings' => 'hashone_team_twitter'.$i, 'section' => 'hashone_team_section'.$i, 'type' => 'url', 'label' => __( 'Twitter Url', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_team_google_plus'.$i, array( 'default' => 'https://plus.google.com', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'hashone_team_google_plus'.$i, array( 'settings' => 'hashone_team_google_plus'.$i, 'section' => 'hashone_team_section'.$i, 'type' => 'url', 'label' => __( 'Google Plus Url', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_team_linkedin'.$i, array( 'default' => 'https://linkedin.com', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'hashone_team_linkedin'.$i, array( 'settings' => 'hashone_team_linkedin'.$i, 'section' => 'hashone_team_linkedin'.$i, 'type' => 'url', 'label' => __( 'Linkedin Url', 'hashone' ) ) ); } /*============COUNTER SECTION PANEL============*/ $wp_customize->add_panel( 'hashone_counter_panel', array( 'title' => __( 'Counter Section', 'hashone' ), 'priority' => 17 ) ); $wp_customize->add_section( 'hashone_counter_title_sec', array( 'title' => __( 'Section Title', 'hashone' ), 'panel' => 'hashone_counter_panel' ) ); $wp_customize->add_setting( 'hashone_counter_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_counter_title', array( 'settings' => 'hashone_counter_title', 'section' => 'hashone_counter_title_sec', 'type' => 'text', 'label' => __( 'Title', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_counter_sub_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_counter_sub_title', array( 'settings' => 'hashone_counter_sub_title', 'section' => 'hashone_counter_title_sec', 'type' => 'textarea', 'label' => __( 'Sub Title', 'hashone' ) ) ); //COUNTERS for( $i = 1; $i < 5; $i++ ){ $wp_customize->add_section( 'hashone_counter_sec'.$i, array( 'title' => __( 'Counter ', 'hashone' ).$i, 'panel' => 'hashone_counter_panel' ) ); $wp_customize->add_setting( 'hashone_counter_title'.$i, array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_counter_title'.$i, array( 'settings' => 'hashone_counter_title'.$i, 'section' => 'hashone_counter_sec'.$i, 'type' => 'text', 'label' => __( 'Title', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_counter_count'.$i, array( 'default' => '', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( 'hashone_counter_count'.$i, array( 'settings' => 'hashone_counter_count'.$i, 'section' => 'hashone_counter_sec'.$i, 'type' => 'number', 'label' => __( 'Counter Value', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_counter_icon'.$i, array( 'default' => 'fa-bell', 'sanitize_callback' => 'hashone_sanitize_choices' ) ); $wp_customize->add_control( new Hashone_Dropdown_Chooser( $wp_customize, 'hashone_counter_icon'.$i, array( 'settings' => 'hashone_counter_icon'.$i, 'section' => 'hashone_counter_sec'.$i, 'choices' => $fontawesome_choices, 'label' => __( 'Counter Icon', 'hashone' ) ) ) ); } /*============CLIENTS LOGO SECTION============*/ $wp_customize->add_panel( 'hashone_client_logo', array( 'title' => __( 'Clients Logo Section', 'hashone' ), 'priority' => 18 ) ); $wp_customize->add_section( 'hashone_logo_title_sec', array( 'title' => __( 'Clients Logo Title', 'hashone' ), 'panel' => 'hashone_client_logo' ) ); $wp_customize->add_setting( 'hashone_logo_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_logo_title', array( 'settings' => 'hashone_logo_title', 'section' => 'hashone_logo_title_sec', 'type' => 'text', 'label' => __( 'Title', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_logo_sub_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_logo_sub_title', array( 'settings' => 'hashone_logo_sub_title', 'section' => 'hashone_logo_title_sec', 'type' => 'textarea', 'label' => __( 'Sub Title', 'hashone' ) ) ); //CLIENTS LOGOS $wp_customize->add_section( 'hashone_client_logo_section', array( 'title' => __( 'Clients Logos', 'hashone' ), 'panel' => 'hashone_client_logo' ) ); $wp_customize->add_setting( 'hashone_client_logo_image', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( new Hashone_Customize_Multi_Image( $wp_customize, 'hashone_client_logo_image', array( 'settings' => 'hashone_client_logo_image', 'section' => 'hashone_client_logo_section', 'label' => __( 'Upload Clients Logos', 'hashone' ), ) ) ); /*============TESTIMONIAL PANEL============*/ $wp_customize->add_panel( 'hashone_testimonial_panel', array( 'title' => __( 'Testimonial Section', 'hashone' ), 'priority' => 19 ) ); $wp_customize->add_section( 'hashone_testimonial_title_sec', array( 'title' => __( 'Testimonial Title', 'hashone' ), 'panel' => 'hashone_testimonial_panel' ) ); $wp_customize->add_setting( 'hashone_testimonial_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_testimonial_title', array( 'settings' => 'hashone_testimonial_title', 'section' => 'hashone_testimonial_title_sec', 'type' => 'text', 'label' => __( 'Title', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_testimonial_sub_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_testimonial_sub_title', array( 'settings' => 'hashone_testimonial_sub_title', 'section' => 'hashone_testimonial_title_sec', 'type' => 'textarea', 'label' => __( 'Sub Title', 'hashone' ) ) ); //TESTIMONIAL PAGES $wp_customize->add_section( 'hashone_testimonial_sec', array( 'title' => __( 'Testimonial Pages', 'hashone' ), 'panel' => 'hashone_testimonial_panel' ) ); $wp_customize->add_setting( 'hashone_testimonial_header', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( new Hashone_Customize_Heading( $wp_customize, 'hashone_testimonial_header', array( 'settings' => 'hashone_testimonial_header', 'section' => 'hashone_testimonial_sec', 'label' => __( 'Testimonial', 'hashone' ) ) ) ); $wp_customize->add_setting( 'hashone_testimonial_page', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_choices' ) ); $wp_customize->add_control( new Hashone_Dropdown_Multiple_Chooser( $wp_customize, 'hashone_testimonial_page', array( 'settings' => 'hashone_testimonial_page', 'section' => 'hashone_testimonial_sec', 'choices' => $hashone_page_choice, 'label' => __( 'Select the Pages', 'hashone' ), 'placeholder' => __( 'Select Multiple Pages', 'hashone' ), ) ) ); /*============BLOG PANEL============*/ $wp_customize->add_panel( 'hashone_blog_panel', array( 'title' => __( 'Blog Section', 'hashone' ), 'priority' => 20 ) ); $wp_customize->add_section( 'hashone_blog_title_sec', array( 'title' => __( 'Blog Title', 'hashone' ), 'panel' => 'hashone_blog_panel' ) ); $wp_customize->add_setting( 'hashone_blog_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_blog_title', array( 'settings' => 'hashone_blog_title', 'section' => 'hashone_blog_title_sec', 'type' => 'text', 'label' => __( 'Title', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_blog_sub_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_blog_sub_title', array( 'settings' => 'hashone_blog_sub_title', 'section' => 'hashone_blog_title_sec', 'type' => 'textarea', 'label' => __( 'Sub Title', 'hashone' ) ) ); //BLOG SETTINGS $wp_customize->add_section( 'hashone_blog_setting_sec', array( 'title' => __( 'Blog Settings', 'hashone' ), 'panel' => 'hashone_blog_panel' ) ); $wp_customize->add_setting( 'hashone_blog_post_count', array( 'default' => '3', 'sanitize_callback' => 'hashone_sanitize_choices' ) ); $wp_customize->add_control( new Hashone_Dropdown_Chooser( $wp_customize, 'hashone_blog_post_count', array( 'settings' => 'hashone_blog_post_count', 'section' => 'hashone_blog_setting_sec', 'label' => __( 'Number of Posts to show', 'hashone' ), 'choices' => $hashone_post_count_choice ) ) ); $wp_customize->add_setting( 'hashone_blog_cat_exclude', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( new Hashone_Customize_Checkbox_Multiple( $wp_customize, 'hashone_blog_cat_exclude', array( 'label' => 'Exclude Category from Blog Posts', 'section' => 'hashone_blog_setting_sec', 'settings' => 'hashone_blog_cat_exclude', 'choices' => $hash_cat ) ) ); /*============CONTACT PANEL============*/ $wp_customize->add_panel( 'hashone_contact_panel', array( 'title' => __( 'Contact Section', 'hashone' ), 'priority' => 21 ) ); $wp_customize->add_section( 'hashone_contact_title_sec', array( 'title' => __( 'Contact Title', 'hashone' ), 'panel' => 'hashone_contact_panel' ) ); $wp_customize->add_setting( 'hashone_contact_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_contact_title', array( 'settings' => 'hashone_contact_title', 'section' => 'hashone_contact_title_sec', 'type' => 'text', 'label' => __( 'Title', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_contact_sub_title', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_contact_sub_title', array( 'settings' => 'hashone_contact_sub_title', 'section' => 'hashone_contact_title_sec', 'type' => 'textarea', 'label' => __( 'Sub Title', 'hashone' ) ) ); $wp_customize->add_section( 'hashone_contact_form_sec', array( 'title' => __( 'Contact Us Form', 'hashone' ), 'panel' => 'hashone_contact_panel' ) ); $wp_customize->add_setting( 'hashone_contact_form', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_contact_form', array( 'settings' => 'hashone_contact_form', 'section' => 'hashone_contact_form_sec', 'type' => 'text', 'label' => __( 'Contact Form ShortCode', 'hashone' ), 'description' => __( 'Add shortcode for Contact form or go to to widget page to add your own widget.', 'hashone' ), ) ); $wp_customize->add_setting( 'hashone_contact_detail', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_contact_detail', array( 'settings' => 'hashone_contact_detail', 'section' => 'hashone_contact_form_sec', 'type' => 'textarea', 'label' => __( 'Contact Detail', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_contact_address', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_contact_address', array( 'settings' => 'hashone_contact_address', 'section' => 'hashone_contact_form_sec', 'type' => 'text', 'label' => __( 'Contact Address', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_contact_phone', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_contact_phone', array( 'settings' => 'hashone_contact_phone', 'section' => 'hashone_contact_form_sec', 'type' => 'text', 'label' => __( 'Phone', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_contact_email', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_contact_email', array( 'settings' => 'hashone_contact_email', 'section' => 'hashone_contact_form_sec', 'type' => 'text', 'label' => __( 'Email', 'hashone' ) ) ); $wp_customize->add_setting( 'hashone_contact_website', array( 'default' => '', 'sanitize_callback' => 'hashone_sanitize_text' ) ); $wp_customize->add_control( 'hashone_contact_website', array( 'settings' => 'hashone_contact_website', 'section' => 'hashone_contact_form_sec', 'type' => 'text', 'label' => __( 'Website', 'hashone' ) ) ); } add_action( 'customize_register', 'hashone_customize_register' ); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function hashone_customize_preview_js() { wp_enqueue_script( 'hashone-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true ); } add_action( 'customize_preview_init', 'hashone_customize_preview_js' ); function hashone_customizer_script() { wp_enqueue_script( 'hashone-customizer-script', get_template_directory_uri() .'/inc/js/customizer-scripts.js', array("jquery","jquery-ui-draggable"),'', true ); wp_enqueue_script( 'hashone-customizer-chosen-script', get_template_directory_uri() .'/inc/js/chosen.jquery.js', array("jquery"),'1.4.1', true ); wp_enqueue_style( 'hashone-customizer-chosen-style', get_template_directory_uri() .'/inc/css/chosen.css'); wp_enqueue_style( 'hashone-customizer-style', get_template_directory_uri() .'/inc/css/customizer-style.css'); } add_action( 'customize_controls_enqueue_scripts', 'hashone_customizer_script' ); if( class_exists( 'WP_Customize_Control' ) ): class Hashone_Customize_Multi_Image extends WP_Customize_Control{ public $type = 'multi-image'; public function __construct($manager, $id, $args = array()){ parent::__construct($manager, $id, $args); } public function render_content(){ // get the set values if any $imageSrcs = explode(',', $this->value()); if (!is_array($imageSrcs)) { $imageSrcs = array(); } $this->theTitle(); $this->theButtons(); $this->theUploadedImages($imageSrcs); } protected function theTitle(){ ?> value(); if (!isset($options['image_sources'])) { return ''; } return $options['image_sources']; } public function theButtons(){ ?>
link(); ?> class="multi-images-control-input"/>
choices ) ) return; ?> label ) ) : ?> label ); ?> description ) ) : ?> description; ?> value() ) ? explode( ',', $this->value() ) : $this->value(); ?> link(); ?> value="" /> label ) ) : ?>

label ); ?>

choices ) ) return; ?> choices ) ) return; ?> cats = get_categories($options); parent::__construct( $manager, $id, $args ); } public function render_content(){ if(!empty($this->cats)){ ?> 'Left', 'right' => 'Right', 'center' => 'Center', ); if ( array_key_exists( $input, $valid ) ) { return $input; } else { return ''; } } function hashone_sanitize_integer( $input ) { if( is_numeric( $input ) ) { return intval( $input ); } } function hashone_sanitize_choices( $input, $setting ) { global $wp_customize; $control = $wp_customize->get_control( $setting->id ); if ( array_key_exists( $input, $control->choices ) ) { return $input; } else { return $setting->default; } }