add_panel( 'andar_settings', array( 'priority' => 20, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Andar Settings', 'andar'), 'description' => '', ) ); //header settings $wp_customize->add_section('header_settings', array( 'title' => __('Header Settings', 'andar'), 'priority' => 20, 'panel' => 'andar_settings', )); $wp_customize->add_setting('logo_text', array( 'default' => 'Andar', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control ('logo_text', array( 'label' => __('Logo Text', 'andar'), 'section' => 'header_settings', 'settings' => 'logo_text', 'type' => 'text', )); $wp_customize->add_setting( 'menu_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'menu_color', array( 'label' => __( 'Menu Color', 'andar' ), 'section' => 'header_settings', 'settings' => 'menu_color', //'priority' => 70, ))); $wp_customize->add_setting( 'menu_hover_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'menu_hover_color', array( 'label' => __( 'Menu Hover Color', 'andar' ), 'section' => 'header_settings', 'settings' => 'menu_hover_color', //'priority' => 70, ))); $wp_customize->add_setting('header_bg', array( 'default' => (get_stylesheet_directory_uri( 'stylesheet_directory') . '/assets/images/bg/bg.jpg'), 'capability' => 'edit_theme_options', 'sanitize_callback' => 'andar_sanitize_upload' )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'header_bg', array( 'label' => __('Backgroud Image', 'andar'), 'section' => 'header_settings', 'settings' => 'header_bg', ))); $wp_customize->add_setting('bg_color', array( 'default' => 'rgba(0, 188, 212, 0.67)', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control ('bg_color', array( 'label' => __('Backgroud Overlay Color (rgba+opacity)', 'andar'), 'section' => 'header_settings', 'settings' => 'bg_color', 'type' => 'text', )); $wp_customize->add_setting('header_text', array( 'default' => 'Andar is awesome wordpress theme', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control ('header_text', array( 'label' => __('Header Text', 'andar'), 'section' => 'header_settings', 'settings' => 'header_text', 'type' => 'text', )); $wp_customize->add_setting('header_desc', array( 'default' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control ('header_desc', array( 'label' => __('Description Text', 'andar'), 'section' => 'header_settings', 'settings' => 'header_desc', 'type' => 'textarea', )); $wp_customize->add_setting('header_button', array( 'default' => 'Learn More', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control ('header_button', array( 'label' => __('Button Text', 'andar'), 'section' => 'header_settings', 'settings' => 'header_button', 'type' => 'text', )); $wp_customize->add_setting('button_link', array( 'default' => '#about-us', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control ('button_link', array( 'label' => __('Button Link', 'andar'), 'section' => 'header_settings', 'settings' => 'button_link', 'type' => 'text', )); //footer settings $wp_customize->add_section('footer_settings', array( 'title' => __('Footer Settings', 'andar'), 'priority' => 20, 'panel' => 'andar_settings', )); $wp_customize->add_setting('copyright', array( 'default' => 'copyright 2016 andar allright reserved', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control ('copyright', array( 'label' => __('Copyright Text', 'andar'), 'section' => 'footer_settings', 'settings' => 'copyright', 'type' => 'text', )); $wp_customize->add_setting('facebook_link', array( 'default' => '#', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control ('facebook_link', array( 'label' => __('Facebook Link', 'andar'), 'section' => 'footer_settings', 'settings' => 'facebook_link', 'type' => 'text', )); $wp_customize->add_setting('twitter_link', array( 'default' => '#', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control ('twitter_link', array( 'label' => __('Twitter Link', 'andar'), 'section' => 'footer_settings', 'settings' => 'twitter_link', 'type' => 'text', )); $wp_customize->add_setting('dribbble_link', array( 'default' => '#', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control ('dribbble_link', array( 'label' => __('Dribbble Link', 'andar'), 'section' => 'footer_settings', 'settings' => 'dribbble_link', 'type' => 'text', )); $wp_customize->add_setting('googleplus_link', array( 'default' => '#', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control ('googleplus_link', array( 'label' => __('Google+ Link', 'andar'), 'section' => 'footer_settings', 'settings' => 'googleplus_link', 'type' => 'text', )); //typography settings $wp_customize->add_section('typography_settings', array( 'title' => __('Typography Settings', 'andar'), 'priority' => 20, 'panel' => 'andar_settings', )); $wp_customize->add_setting('font', array( 'default' => 'Open+Sans', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control ('font', array( 'label' => __('Select Font', 'andar'), 'section' => 'typography_settings', 'settings' => 'font', 'type' => 'select', 'choices' => $fonts, )); $wp_customize->add_setting( 'site_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'site_color', array( 'label' => __( 'Site Color', 'andar' ), 'section' => 'typography_settings', 'settings' => 'site_color', //'priority' => 70, ))); $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; } add_action( 'customize_register', 'andar_customize_register' ); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function andar_customize_preview_js() { wp_enqueue_script( 'andar_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true ); } add_action( 'customize_preview_init', 'andar_customize_preview_js' );