I have a wordpress theme that I am modifying the look and feel by making a child theme.
The parent theme I am using uses the redux framework.
Im a bit new to using filters and hooks, but I want to add/modify a section on the options page.
I found a function to add sections through the child theme but I don't know how to use it.
When I include the code in my child-theme functions.php I get an error saying it can't be re-defined.
This is the example it shows in the options.php file.
Can anyone help explain how to use this function or point me to some concise explanations on how it should be used.
Thanks!
/*
*
* Custom function for filtering the sections array. Good for child themes to override or add to the sections.
* Simply include this function in the child themes functions.php file.
*
* NOTE: the defined constansts for URLs, and directories will NOT be available at this point in a child theme,
* so you must use get_template_directory_uri() if you want to use any of the built in icons
*
*/
function add_another_section($sections){
//$sections = array();
$sections[] = array(
'title' => __('A Section added by hook', AZ_THEME_NAME),
'desc' => __('<p class="description">This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.</p>', AZ_THEME_NAME),
'icon' => 'paper-clip',
'icon_class' => 'icon-large',
// Leave this as a blank section, no options just some intro text set above.
'fields' => array()
);
return $sections;
}
//add_filter('redux-opts-sections-twenty_eleven', 'add_another_section');