get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'brillo_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'brillo_customize_partial_blogdescription', ) ); } } add_action( 'customize_register', 'brillo_customize_register' ); /** * Render the site title for the selective refresh partial. * * @return void */ function brillo_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function brillo_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function brillo_customize_preview_js() { wp_enqueue_script( 'brillo-customizer', get_template_directory_uri() . '/assets/js/customizer.js', array( 'customize-preview' ), '1.0.0', true ); } add_action( 'customize_preview_init', 'brillo_customize_preview_js' ); // Brillo Customizer Settings function brillo_customizer_settings( $wp_customize ){ // panel $wp_customize->add_panel( 'brillo_panel', array( 'title' => __('Brillo Options', 'brillo'), ) ); // //section $wp_customize->add_section('brillo_general_settings',array( 'title' => __('General Settings','brillo'), 'panel' => 'brillo_panel' )); $wp_customize->add_section('brillo_header_settings',array( 'title' => __('Header Settings', 'brillo'), 'panel' => 'brillo_panel' )); $wp_customize->add_section('brillo_pt_settings',array( 'title' => __('Page title Settings','brillo'), 'panel' => 'brillo_panel' )); $wp_customize->add_section('brillo_blog_settings',array( 'title' => __('Blog Settings','brillo'), 'panel' => 'brillo_panel' )); $wp_customize->add_section('brillo_footer_settings',array( 'title' => __('Footer Settings','brillo'), 'panel' => 'brillo_panel' )); // Header area field $wp_customize->add_setting('brillo_topbar_status',array( 'default' => 'off', 'transport' => 'postMessage', 'sanitize_callback' => 'brillo_sanitize_select' )); $wp_customize->add_control( 'brillo_topbar_status', array( 'section' => 'brillo_header_settings', 'label' => __('Enable / Disable Topbar','brillo'), 'type' => 'radio', 'choices' => array( 'on' => __('Enable','brillo'), 'off' => __('Disable','brillo'), ) ) ); $wp_customize->add_setting('brillo_topbar_left',array( 'sanitize_callback' => 'brillo_sanitize_input', 'default' => __('Call Us : 012036 039    |    Email : yourmail@gmail.com','brillo'), 'transport' => 'postMessage', )); $wp_customize->add_control( 'brillo_topbar_left', array( 'section' => 'brillo_header_settings', 'label' => __('Topbar left','brillo'), 'type' => 'textarea', ) ); $wp_customize->add_setting('brillo_topbar_right',array( 'sanitize_callback' => 'brillo_sanitize_input', 'default' => __('Welcome to Our Web Site','brillo'), 'transport' => 'postMessage', )); $wp_customize->add_control( 'brillo_topbar_right', array( 'section' => 'brillo_header_settings', 'label' => __('Topbar Right','brillo'), 'type' => 'textarea', ) ); // Footer Area Field $wp_customize->add_setting('brillo_footer_top',array( 'default' => 'off', 'transport' => 'refresh', 'sanitize_callback' => 'brillo_sanitize_checkbox' )); $wp_customize->add_control( 'brillo_footer_top', array( 'section' => 'brillo_footer_settings', 'label' => __('Enable / Disable Footer','brillo'), 'type' => 'checkbox' ) ); $wp_customize->add_setting('brillo_footer_copyright',array( 'default' => 'on', 'transport' => 'refresh', 'sanitize_callback' => 'brillo_sanitize_checkbox' )); $wp_customize->add_control( 'brillo_footer_copyright', array( 'section' => 'brillo_footer_settings', 'label' => __('Enable / Disable Copyright','brillo'), 'type' => 'checkbox' ) ); $wp_customize->add_setting('brillo_footer_copyright_text',array( 'sanitize_callback' => 'brillo_sanitize_input', 'transport' => 'postMessage', 'default' => __('Copyright © All Right Reserved.','brillo'), )); $wp_customize->add_control( 'brillo_footer_copyright_text', array( 'section' => 'brillo_footer_settings', 'label' => __('Footer copyright text','brillo'), 'type' => 'textarea', ) ); $wp_customize->add_setting('brillo_footer_col_size',array( 'default' => '4', 'transport' => 'refresh', 'sanitize_callback' => 'brillo_sanitize_select' )); $wp_customize->add_control( 'brillo_footer_col_size', array( 'section' => 'brillo_footer_settings', 'label' => __('Footer column size','brillo'), 'type' => 'select', 'choices' => array( '1' => __('1 Column','brillo'), '2' => __('2 Column','brillo'), '3' => __('3 Column','brillo'), '4' => __('4 column','brillo'), '5' => __('5 Column','brillo'), ), ) ); // blog $wp_customize->add_setting('brillo_blog_layout',array( 'default' => 'none', 'transport' => 'refresh', 'sanitize_callback' => 'brillo_sanitize_select' )); $wp_customize->add_control( 'brillo_blog_layout', array( 'section' => 'brillo_blog_settings', 'label' => __('Blog Layout','brillo'), 'type' => 'select', 'choices' => array( 'none' => __('No sidebar','brillo'), 'left' => __('Left Sidebar','brillo'), 'right' => __('Right Sidebar','brillo'), ), ) ); $wp_customize->add_setting('brillo_blog_col_size',array( 'default' => '1', 'transport' => 'refresh', 'sanitize_callback' => 'brillo_sanitize_select' )); $wp_customize->add_control( 'brillo_blog_col_size', array( 'section' => 'brillo_blog_settings', 'label' => __('Blog column size','brillo'), 'type' => 'select', 'choices' => array( '1' => __('1 Column','brillo'), '2' => __('2 Column','brillo'), '3' => __('3 Column','brillo'), '4' => __('4 column','brillo'), ), ) ); $wp_customize->add_setting('brillo_blog_excerpt_length',array( 'default' => '20', 'transport' => 'refresh', 'sanitize_callback' => 'brillo_sanitize_absinteger' )); $wp_customize->add_control( 'brillo_blog_excerpt_length', array( 'section' => 'brillo_blog_settings', 'label' => __('Blog excerpt length','brillo'), 'type' => 'textbox' ) ); $wp_customize->add_setting('brillo_page_title',array( 'default' => 'on', 'transport' => 'refresh', 'sanitize_callback' => 'brillo_sanitize_checkbox' )); $wp_customize->add_control( 'brillo_page_title', array( 'section' => 'brillo_pt_settings', 'label' => __('Enable / Disable Page title','brillo'), 'type' => 'checkbox' ) ); $wp_customize->add_setting('brillo_breadcrumb',array( 'default' => 'on', 'transport' => 'refresh', 'sanitize_callback' => 'brillo_sanitize_checkbox' )); $wp_customize->add_control( 'brillo_breadcrumb', array( 'section' => 'brillo_pt_settings', 'label' => __('Enable / Disable Breadcrumb','brillo'), 'type' => 'checkbox' ) ); // page title section $wp_customize->add_setting( 'brillo_pt_section_bg_color', array( 'transport' => 'postMessage', 'default' => '#dddddd', 'sanitize_callback' => 'brillo_sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'brillo_pt_section_bg_color', array( 'label' => __('Background Color','brillo'), 'section' => 'brillo_pt_settings', ) ) ); $wp_customize->add_setting( 'brillo_pt_section_bg_image', array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'brillo_pt_section_bg_image', array( 'label' => __('Background Image','brillo'), 'section' => 'brillo_pt_settings', ) ) ); $wp_customize->add_setting( 'brillo_pt_section_bg_image_size', array( 'transport' => 'postMessage', 'default' => 'initial', 'sanitize_callback' => 'brillo_sanitize_select' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'brillo_pt_section_bg_image_size', array( 'label' => __('Size','brillo'), 'type' => 'select', 'section' => 'brillo_pt_settings', 'choices' => array( 'initial' => __('Default','brillo'), 'auto' => __('Auto','brillo'), 'cover' => __('Cover','brillo'), 'contain' => __('Contain','brillo'), ), ) ) ); $wp_customize->add_setting('brillo_pt_section_padding',array( 'transport' => 'postMessage', 'default' => '215px', 'sanitize_callback' => 'brillo_sanitize_input' )); $wp_customize->add_control( 'brillo_pt_section_padding', array( 'section' => 'brillo_pt_settings', 'label' => __('Page title section Top and bottom padding','brillo'), 'type' => 'textbox', ) ); } add_action( 'customize_register', 'brillo_customizer_settings' );