I am using a theme which uses the Redux framework for customisation options. I have created a child theme to customise this theme. In the theme framework I want to edit one of the files. To do this I thought I could just copy the file to my child theme and it would override but it seems not. A bit of research says I can use a filter in my functions file to do this but I’m not sure how to go about it.
The section of code I want to edit looks like this and is in my customizer.php file
$this->sections[] = array(
'title' => esc_html__('Footer', 'maverick-theme'),
'desc' => esc_html__('Configure footer styles.', 'maverick-theme'),
'subsection' => true,
'fields' => array(
array(
'id' => 'customizer-footer-bg-color',
'type' => 'color',
'title' => esc_html__('Background Color', 'maverick-theme'),
'default' => '',
'output' => array('background-color' => '#main-footer, #bottom-footer')
),
array(
'id' => 'customizer-footer-social-color',
'type' => 'color',
'title' => esc_html__('Social Icon Color', 'maverick-theme'),
'default' => '',
'output' => array('color' => '#bottom-footer .social-icons li a')
),
array(
'id' => 'customizer-footer-social-hover-color',
'type' => 'color',
'title' => esc_html__('Social Icon Hover Color', 'maverick-theme'),
'default' => '',
'output' => array('color' => '#bottom-footer .social-icons li a:hover i'),
'important' => true
),
),
);
Many thanks
1 Answer
If you need to add the settings in parent theme created section, just place the below code in child functions.php
But remember to replace OPT Name with your_opt_name in “OPT_NAME”.(To find OPT Name just open /parent-theme/includes/options/options-config.php and in top there’s a line $opt_name=”your_opt_name“; )
function add_product_description($sections){
$sections[10]['fields'][] = array(
'id' => 'product_extra_description',
'type' => 'multi_text',
'title' => __( 'Product Description', 'nm-framework-admin' ),
'desc' => __( 'Enter extra Product Description.', 'nm-framework-admin' ),
'validate' => 'html'
);
return $sections;
}
// In this example OPT_NAME is the returned opt_name.
//add_filter("redux/options/OPT_NAME/sections", 'add_another_section_bl');
add_filter("redux/options/OPT_NAME/sections", 'add_product_description');
Also in $sections[10], you need to replace with your indexing. And to find it you need to print_r the $section.