Color Options from Theme Customizer API not returning via get_theme_mod()

If your settings are stored as Theme Mods, rather than as a Settings API option, then you need to pass the appropriate value to the type parameter to $wp_customize->add_setting():

  • 'option': Settings API option (get_option())
  • 'theme_mod': Theme Mods API option (get_theme_mod())

Try changing this:

$wp_customize->add_setting( $this_theme . '_theme_options['. $setting .']', array(
    'default' => $param['default'],
    'sanitize_callback' => 'sanitize_hex_color',
    'type' => 'option',
    'capability' => 'edit_theme_options',
    'priority' => $i

) );

…to this:

$wp_customize->add_setting( $this_theme . '_theme_options['. $setting .']', array(
    'default' => $param['default'],
    'sanitize_callback' => 'sanitize_hex_color',
    // CHANGE ME HERE
    'type' => 'theme_mod',
    'capability' => 'edit_theme_options',
    'priority' => $i

) );