Extending Redux Theme Options Panel in Avada Child Theme
- November 30, 2016
- Leave a comment
Redux is the best option for Theme Options Panel in the market. This framework is widely used by almost all themes for their theme options panel. In this article, you will learn to extend theme options panel for Avada Child Theme.
Extending the theme options panel means that you want to add new options in your theme. By using the redux hook, you can extend this functionality. The redux options are defined by the redux directory name and redux option name. You can use the redux filter hook as follows:
Note: redux = redux directory, theme_options = theme option name, pt_redux_section_function = the custom function called to extend theme options.
While registering redux theme options panel, these settings should be considered. You can use the above mentioned line of code in your Theme‘s functions.php file. If you are using a child theme, add this code in your Child Theme‘s functions.php file.
If you want to extend the theme options panel in Avada Theme, the above mentioned line of code will not work due to the following reasons:
- “redux” is not the directory of redux framework in Avada Theme
- “theme_options” is not the theme option name which Avada Theme uses to save theme option settings
You can use the following line of code for extending the theme options panel in Avada Theme:
Note: avadaredux = redux framework directory in Avada Theme, avada_theme_options = avada theme option settings name in the database.
Below is an example of how you can add more options in Avada Child Theme panel:
* Adding PressTigers in Theme options page
* @param array $sections
* @return array
$sections = array(
'id' => 'presstigers-user-profile',
'title' => 'User Profile Settings',
'subsection' => true,
'heading' => 'PressTigers User Profile Settings',
'fields' => array(
'id' => 'pt-opt-user-profile-header-bg',
'type' => 'background',
'title' => __( 'User Profile Header Background', 'presstigers' ),