add_section('body_typography_section', array( 'title' => __('Body Typography', 'arcs'), 'priority' => 30, )); $wp_customize->add_setting('body_font_source', array( 'default' => 'google', // 'google' or 'custom' 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('body_font_source', array( 'label' => __('Font Source', 'arcs'), 'section' => 'body_typography_section', 'type' => 'radio', 'choices' => array( 'google' => __('Google Fonts', 'arcs'), // Remove 'custom' from here ), )); $wp_customize->add_setting('body_google_font', array( 'default' => 'Open Sans, sans-serif', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('body_google_font', array( 'label' => __('Google Font', 'arcs'), 'section' => 'body_typography_section', 'type' => 'select', 'choices' => array( 'Open Sans, sans-serif' => 'Open Sans', 'Roboto, sans-serif' => 'Roboto', 'Lato, sans-serif' => 'Lato', 'Montserrat, sans-serif' => 'Montserrat', 'Inter, sans-serif' => 'Inter', 'Roboto Condensed, sans-serif' => 'Roboto Condensed', 'Single Day, cursive' => 'Single Day', 'Poppins, sans-serif' => 'Poppins', 'Raleway, sans-serif' => 'Raleway', 'Merriweather, serif' => 'Merriweather', 'Nunito, sans-serif' => 'Nunito', 'Oswald, sans-serif' => 'Oswald', 'Playfair Display, serif' => 'Playfair Display', 'Source Sans Pro, sans-serif' => 'Source Sans Pro', 'Roboto Slab, serif' => 'Roboto Slab', 'Quicksand, sans-serif' => 'Quicksand', 'Abril Fatface, cursive' => 'Abril Fatface', 'Lora, serif' => 'Lora', 'Ubuntu, sans-serif' => 'Ubuntu', 'PT Sans, sans-serif' => 'PT Sans', 'Noto Sans, sans-serif' => 'Noto Sans', 'Fira Sans, sans-serif' => 'Fira Sans', 'Cinzel, serif' => 'Cinzel', 'Pale Violet Red, cursive' => 'Pale Violet Red', 'Anton, sans-serif' => 'Anton', 'Droid Sans, sans-serif' => 'Droid Sans', 'Karla, sans-serif' => 'Karla', 'Inconsolata, monospace' => 'Inconsolata', 'Exo 2, sans-serif' => 'Exo 2', 'Bebas Neue, sans-serif' => 'Bebas Neue', 'Chewy, cursive' => 'Chewy', ), 'active_callback' => function () use ($wp_customize) { return $wp_customize->get_setting('body_font_source')->value() === 'google'; }, )); $wp_customize->add_setting('body_font_size', array( 'default' => '16px', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('body_font_size', array( 'label' => __('Font Size', 'arcs'), 'section' => 'body_typography_section', )); $wp_customize->add_setting('body_font_style', array( 'default' => 'normal', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('body_font_style', array( 'label' => __('Font Style', 'arcs'), 'section' => 'body_typography_section', 'type' => 'select', 'choices' => array( 'normal' => __('Normal', 'arcs'), 'italic' => __('Italic', 'arcs'), 'oblique' => __('Oblique', 'arcs'), 'unset' => __('Unset', 'arcs'), 'revert' => __('Revert', 'arcs'), 'revert-layer' => __('Revert-layer', 'arcs'), 'initial' => __('Initial', 'arcs'), 'inherit' => __('Inherit', 'arcs'), ), )); $wp_customize->add_setting('body_font_weight', array( 'default' => '400', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('body_font_weight', array( 'label' => __('Font Weight', 'arcs'), 'section' => 'body_typography_section', )); $wp_customize->add_setting('body_font_color', array( 'default' => '#000000', // Set your default color 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control('body_font_color', array( 'label' => __('Body Font Color', 'arcs'), 'section' => 'body_typography_section', 'type' => 'color', )); } add_action('customize_register', 'customize_body_typography'); function apply_custom_typography() { $font_source = get_theme_mod('body_font_source', 'google'); $font_family = $font_source === 'google' ? get_theme_mod('body_google_font', 'Open Sans, sans-serif') : ''; // Removed fallback for custom fonts $font_size = get_theme_mod('body_font_size', '16px'); $font_style = get_theme_mod('body_font_style', 'normal'); $font_weight = get_theme_mod('body_font_weight', '400'); $font_color = get_theme_mod('body_font_color', '#000000'); ?>