/* ---------- Social icons helper and Customizer fields ---------- */

/* Inline SVG helper for social icons */
function jc_svg_icon( $name = '' ) {
    $icons = array(
        'twitter' => '<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M22 5.92c-.66.29-1.37.49-2.12.58.76-.46 1.34-1.18 1.61-2.04-.71.42-1.5.73-2.34.9A3.6 3.6 0 0016.5 4c-1.98 0-3.59 1.6-3.59 3.58 0 .28.03.55.09.81-2.99-.15-5.64-1.58-7.42-3.76-.31.53-.49 1.15-.49 1.81 0 1.25.64 2.36 1.62 3.01-.6-.02-1.17-.18-1.66-.46v.05c0 1.74 1.24 3.19 2.88 3.52-.3.08-.62.12-.95.12-.23 0-.46-.02-.68-.06.46 1.44 1.8 2.49 3.39 2.52A7.22 7.22 0 013 19.54 10.2 10.2 0 008.29 21c6.29 0 9.73-5.21 9.73-9.73v-.44c.67-.48 1.25-1.08 1.71-1.77-.62.28-1.28.47-1.97.56z"/></svg>',
        'instagram' => '<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M7 2h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5V7a5 5 0 015-5zm5 5.9a4.1 4.1 0 100 8.2 4.1 4.1 0 000-8.2zm6.4-.6a1.2 1.2 0 11-2.4 0 1.2 1.2 0 012.4 0zM12 9.5a2.5 2.5 0 110 5 2.5 2.5 0 010-5z"/></svg>',
    );

    return isset( $icons[ $name ] ) ? $icons[ $name ] : '';
}

/* Add Customizer settings for social links */
add_action( 'customize_register', function( $wp_customize ) {
    $wp_customize->add_section( 'jc_social_section', array(
        'title'    => __( 'Social Links', 'jc-theme' ),
        'priority' => 40,
    ) );

    $wp_customize->add_setting( 'jc_site_twitter', array(
        'default'           => '',
        'sanitize_callback' => 'esc_url_raw',
    ) );
    $wp_customize->add_control( 'jc_site_twitter', array(
        'label'    => __( 'Twitter URL', 'jc-theme' ),
        'section'  => 'jc_social_section',
        'type'     => 'url',
    ) );

    $wp_customize->add_setting( 'jc_site_instagram', array(
        'default'           => '',
        'sanitize_callback' => 'esc_url_raw',
    ) );
    $wp_customize->add_control( 'jc_site_instagram', array(
        'label'    => __( 'Instagram URL', 'jc-theme' ),
        'section'  => 'jc_social_section',
        'type'     => 'url',
    ) );
} );

/* Enqueue header CSS and JS */
add_action( 'wp_enqueue_scripts', function() {
    // Use stylesheet directory so child theme works if active
    $dir = get_stylesheet_directory_uri();
    wp_enqueue_style( 'jc-header-style', $dir . '/jc-header.css', array(), '1.0' );
    wp_enqueue_script( 'jc-header-js', $dir . '/jc-header.js', array(), '1.0', true );
} );
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://cochranemarket.com/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://cochranemarket.com/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://cochranemarket.com/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://cochranemarket.com/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://cochranemarket.com/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
