[Solved] How can I add any Divi module to my WordPress blog sidebar?

  

3
Topic starter

I have a WP site built with Divi theme.

How can I add any Divi module to the sidebar of my blog? 

Maybe some shortcode or code in the child theme?

Thanks!

1 Answer
2

Here's useful video explaining just that: 

You can manually insert the Divi module using custom PHP code in your child theme’s functions.php.

  1. Create a new Divi layout containing the desired module in the Divi Library.
  2. Add code in your child theme to call the layout in the sidebar area:
//Divi module in sidebar
add_action('get_sidebar', 'add_divi_module_to_sidebar');
function add_divi_module_to_sidebar() {
    echo do_shortcode('[divi_shortcode]');
}
Share: