DIVI 3.0 HACK #1: How to copy the fullwidth Menu module over to the Standard Module Section with the use of a child theme

It has been a few versions since I have updated this hack, but will all the extra code added to the theme since DIVI 2.4 I did a new version for DIVI 3.0 and in a child theme.

First we start off with the functions.php file:

This is the code that gets added to the file...

function elegant_enqueue_css() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); }
add_action( 'wp_enqueue_scripts', 'elegant_enqueue_css' );
function divi_child_theme_setup() {
if ( class_exists('ET_Builder_Module')) {
get_template_part( 'custom-modules/nonfullwidthmenu' );
$cbm3 = new NM_Builder_Module_NONfullwidth_menu();
add_shortcode( 'et_pb_nonfullwidthmenu', array($cbm3, '_shortcode_callback') ); }
} add_action('et_builder_ready', 'divi_child_theme_setup');



The main thing you are doing here is a calling the nonfullwidthmenu.php file that is in the custom-modules directory. The code also winds up help adding the module to list of modules you can use.

Finally we look at the nonfullwidthmenu.php file to show off all the changes to it.
It gets more changes to it.
class NM_Builder_Module_NONfullwidth_menu extends ET_Builder_Module {
function init() {
$this->name = esc_html__( 'NONfullwidth Menu', 'et_builder' );
$this->slug = 'et_pb_fullwidth_menu';
$this->fb_support = true;
$this->fullwidth = false;

A look at the code shows two extra lines added to it compared to DIVI 2.4. Fullwidth is set to false so it will show up in the standard section module list. Fb_support is set to true so it shows up and works on the front page builder.

Now since version 2.4 the module get an extra like 50 lines of code added to it so we have to copy and paste over in a couple of spots.

Every where I saw ET_Builder_Module_Fullwidth_Menu it had to replaced with NM_Builder_Module_NONfullwidth_menu so no errors pop up. This had to occut only a couple times.

And lastly

The final line of text got changed to this:

new NM_Builder_Module_NONfullwidth_menu;

The great thing about this way of doing it that since the new module is in a child them you can update the DIVI theme as much you want and you should not get into problems unless a major code change occurs to the theme.

DIVI 2.4 HACK #2: How to copy the fullwidth Menu module over to the Standard Module Section

I noticed when I was looking at the modules for the Standard module area that menu module was missing. Why I do not know, but I found a super simple way to add it......

1) Open Up the main-modules.php file. You are going to find it in the includes/builder/ directory....

Search for Fullwidth Menu...

You will see this line of code.

class ET_Builder_Module_Fullwidth_Menu extends ET_Builder_Module { Select that text plus all the text down to and including

new ET_Builder_Module_Fullwidth_Menu;

At this time you might just want to copy and put that in a new document to make some minor edits to it...

This Text at the top just gets NON added to it

class ET_Builder_NONModule_Fullwidth_Menu extends ET_Builder_Module {
function init() {
$this->name = __( 'NONFullwidth Menu', 'et_builder' );
$this->slug = 'et_pb_NONfullwidth_menu';

This one line of code gets dumped

$this->fullwidth = true;

The final line of text got changed to this:

new ET_Builder_NONModule_Fullwidth_Menu;
Just copy and paste the text into a spot between two modules.... Between the new line of code and the class line of code

Now you are ready to upload the file to the serve and you can wind up with this wonderful output...

If it works right this is what you can see in the back end