add_section('heading_typography_section', array( 'title' => __('Heading Typography', 'arcs'), 'priority' => 31, // Adjust the priority to ensure it appears after the body typography section )); // Define heading levels $headings = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'); // Loop through heading levels to add settings and controls foreach ($headings as $heading) { // Font Size control $wp_customize->add_setting($heading . '_font_size', array( 'default' => '32px', // Default font size for headings 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control($heading . '_font_size', array( 'label' => strtoupper($heading) . ' Font Size', 'section' => 'heading_typography_section', 'type' => 'text', )); // Google Font control $wp_customize->add_setting($heading . '_google_font', array( 'default' => 'Open Sans, sans-serif', // Default Google Font 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control($heading . '_google_font', array( 'label' => strtoupper($heading) . ' Google Font', 'section' => 'heading_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', ), )); // Font Weight control $wp_customize->add_setting($heading . '_font_weight', array( 'default' => 'bold', // Default font weight for headings 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control($heading . '_font_weight', array( 'label' => strtoupper($heading) . ' Font Weight', 'section' => 'heading_typography_section', 'type' => 'text', )); // Font Color control $wp_customize->add_setting($heading . '_font_color', array( 'default' => '#000000', // Default font color for headings 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $heading . '_font_color', array( 'label' => strtoupper($heading) . ' Font Color', 'section' => 'heading_typography_section', ))); // Font Style control (optional) $wp_customize->add_setting($heading . '_font_style', array( 'default' => 'normal', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control($heading . '_font_style', array( 'label' => strtoupper($heading) . ' Font Style', 'section' => 'heading_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'), ), )); } } add_action('customize_register', 'customize_heading_typography'); // Step 2: Define a function to output custom CSS based on typography settings function output_custom_heading_typography_css() { echo ''; } add_action('wp_head', 'output_custom_heading_typography_css');