Source: https://ayanize.com/snippets/how-to-add-widgets-to-vertical-nav-menu-in-divi/
This adds a widget area at the bottom of the default Divi vertical navigation area/menu.
Add the following to the functions.php of the child theme.
// START Add widget area to vertical menu
function divi_vertical_widgets(){
register_sidebar( array(
'name' => 'Vertical Nav Widgets',
'id' => 'ver-nav',
'description' => __('Add widgets to Vertical Menu'),
'before_widget' => '<div id="ver-nav">',
'after_widget' => '</div>',
'before_title' => false,
'after_title' => false
) );
}
function call_widgets_ver_menu() {
$ver_nav = et_get_option( 'vertical_nav');
if ($ver_nav == true){
$output = dynamic_sidebar('ver-nav');
return $output;
}
}
add_filter( 'widgets_init', 'divi_vertical_widgets', 10 );
add_action('et_header_top','call_widgets_ver_menu', 10);
// END Add widget area to vertical menu
Code language: PHP (php)