get_section( 'title_tagline' )->priority = 10; $wp_customize->get_section( 'static_front_page' )->priority = 20; $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', ) ); $wp_customize->remove_control( 'header_textcolor' ); require get_template_directory() . '/inc/google-fonts.php'; } $sections = array( 'header-options','banner-options', 'cta-block', 'color-options', 'blog-options', 'container-width','footer-options'); if( ! empty( $sections ) ) { foreach( $sections as $section ) { require get_template_directory() . '/inc/customizer/sections/options/' . $section . '.php'; } } /** * Enqueue the customizer javascript. */ function alley_themes_customize_preview_js() { wp_enqueue_script( 'alley-themes-customizer-preview', get_template_directory_uri() . '/js/customizer.js', array( 'jquery' ), '1.0.0', true ); } add_action( 'customize_preview_init', 'alley_themes_customize_preview_js' ); /** * Sanitization Functions */ require get_template_directory() . '/inc/customizer/sanitization-functions.php'; add_action( 'customize_register', 'alley_themes_site_identity_settings' ); function alley_themes_site_identity_settings( $wp_customize ) { $wp_customize->add_setting( 'site_title_color_option', array( 'capability' => 'edit_theme_options', 'default' => '#4169e1', 'transport' => 'postMessage', 'sanitize_callback' => 'alley_themes_sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'site_title_color_option', array( 'label' => esc_html__( 'Site Title Color', 'alley-themes' ), 'section' => 'title_tagline', 'settings' => 'site_title_color_option', ) ) ); $wp_customize->add_setting( 'site_title_size', array( 'default' => 30, 'sanitize_callback' => 'absint', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new Alley_Themes_Slider_Control( $wp_customize, 'site_title_size', array( 'section' => 'title_tagline', 'settings' => 'site_title_size', 'label' => esc_html__( 'Logo Size', 'alley-themes' ), 'choices' => array( 'min' => 15, 'max' => 60, 'step' => 1, ) ) ) ); $wp_customize->add_setting( 'site_identity_font_family', array( 'transport' => 'postMessage', 'sanitize_callback' => 'alley_themes_sanitize_google_fonts', 'default' => 'Poppins', ) ); $wp_customize->add_control( 'site_identity_font_family', array( 'settings' => 'site_identity_font_family', 'label' => esc_html__( 'Site Identity Font Family', 'alley-themes' ), 'section' => 'title_tagline', 'type' => 'select', 'choices' => google_fonts(), ) ); }