You are missing _
in add_control
paramater: settings
.
The settings
parameter should be home_features_boxes_icon_' . $i
Full code here:
for ( $i = 1; $i < 7; $i++ ) :
$wp_customize->add_setting( 'home_features_boxes_icon_' . $i, array(
'default' => '',
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'esc_html',
) );
$wp_customize->add_control( 'home_features_boxes_icon_' . $i . '_c', array(
'settings' => 'home_features_boxes_icon_' . $i,
'section' => 'home_features_boxes',
'type' => 'text',
'label' => esc_html__( $i . ' - Box Icon', 'lucathemes' ),
) );
endfor;
On the side note: esc_html
is not a sanitization function. Use sanitize_text_field
for text fields.