Customizer, add option, child theme
-
In the child theme I have developed I’m trying to add an option to the select blog_layout_view (you can find it in Blog settings >Blog Index Settings under Blog Layout section. I’m talking about the one generated by
$wp_customize->add_control(
blog_layout_view’, array(
label’ => esc_html__( ‘Blog Layout’, ‘shapely’ ),
description’ => esc_html__( ‘Choose how you want to display posts in grid’, ‘shapely’ ),
‘section’ => ‘shapely_blog_section’,
type’ => ‘select’,
‘choices’ => array(
‘grid’ => esc_html__( ‘grid only’, ‘shapely’ ),
‘large_image_grid’ => esc_html__( ‘Large Image and Grid’, ‘shapely’ ),
‘large_image’ => esc_html__( ‘Large Images’, ‘shapely’ ),
),
)
);I thought I could do this by editing the function.php file of my child theme by adding in it
function add_new_option_to_select( $choices ) {
$choices[‘new_option’] = ‘New option’;
return $choices;
}
add_filter( ‘customize_option_shapely_blog_section_layout_view_choices’, ‘add_new_option_to_select’, 999);but it doesn’t work… what should be the correct procedure to do this?
- The topic ‘Customizer, add option, child theme’ is closed to new replies.