get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->get_control( 'custom_logo' )->description = __( 'The recommended size for the logo is 120px by 70px.', 'business-center' ); /** * Theme Options for sections */ // Add panel for different sections $wp_customize->add_panel( 'business_center_sections_panel' , array( 'title' => __('Sections','business-center'), 'description'=> __( 'Business Center available sections.', 'business-center' ), 'priority' => 150, ) ); // Load slider options. require get_template_directory() . '/inc/customizer/sections/slider.php'; if ( business_center_is_jetpack_cpt_module_enable( 'jetpack_testimonial' ) ) { // Load testimonial section options. require get_template_directory() . '/inc/customizer/sections/testimonial.php'; } if ( business_center_is_jetpack_cpt_module_enable( 'jetpack_portfolio' ) ) { // Load portfolio section options. require get_template_directory() . '/inc/customizer/sections/portfolio.php'; } /** * Reset section */ // Add reset enable section $wp_customize->add_section( 'business_center_reset_section', array( 'title' => __('Reset all settings','business-center'), 'description' => __( 'Caution: All settings will be reset to default. Refresh the page after clicking Save & Publish.', 'business-center' ), ) ); // Add reset enable setting and control. $wp_customize->add_setting( 'business_center_theme_options[reset_options]', array( 'default' => $options['reset_options'], 'sanitize_callback' => 'business_center_reset_options', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'business_center_theme_options[reset_options]', array( 'label' => __( 'Check to reset all settings', 'business-center' ), 'section' => 'business_center_reset_section', 'type' => 'checkbox', ) ); } add_action( 'customize_register', 'business_center_customize_register' ); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function business_center_customize_preview_js() { wp_enqueue_script( 'business_center_customizer', get_template_directory_uri() . '/assets/js/customizer.min.js', array( 'customize-preview' ), '20151215', true ); } add_action( 'customize_preview_init', 'business_center_customize_preview_js' ); function business_center_inline_css() { $options = business_center_get_theme_options(); $testimonial_bg_image = $options['testimonial_bg_image']; $css = ' /* Testimonial background image */ #client-carousel { background: url("'.esc_url( $testimonial_bg_image ).'") no-repeat fixed; } '; wp_add_inline_style( 'business-center-style', $css ); } add_action( 'wp_enqueue_scripts', 'business_center_inline_css', 10 );