get_setting('blogname')->transport = 'postMessage'; $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; $wp_customize->get_control('background_color')->section = 'azeen_color_options'; $wp_customize->get_control('header_image')->section = 'azeen_header_image'; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'azeen_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'azeen_customize_partial_blogdescription', ) ); } } add_action('customize_register', 'azeen_customize_register'); add_filter('customizer_widgets_section_args', 'azeen_customizer_custom_widget_area', 10, 3); function azeen_customizer_custom_widget_area($section_args, $section_id, $sidebar_id) { if( $sidebar_id === 'sidebar-headeradvertising' ) { $section_args['panel'] = 'azeen_header_options'; } return $section_args; } /** * Render the site title for the selective refresh partial. * * @return void */ function azeen_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function azeen_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function azeen_customize_preview_js() { wp_enqueue_script('azeen_customizer', get_template_directory_uri() . '/assets/js/customizer.js', array( 'customize-preview' ), '20130508', true); } add_action('customize_preview_init', 'azeen_customize_preview_js'); /** * Enqueue script for custom customize control. */ function azeen_customize_enqueue() { wp_enqueue_script( 'azeen_customize_controls', get_template_directory_uri() . '/assets/js/customizer-controls.js', array( 'jquery', 'customize-controls' ), false, true ); } add_action( 'customize_controls_enqueue_scripts', 'azeen_customize_enqueue' );