elegantthemes / create-divi-extension

MIT License
186 stars 59 forks source link

Child theme custom module not available through page builder #426

Open SRD75 opened 3 years ago

SRD75 commented 3 years ago

Problem Description

I've duplicated the Team Member / Person module as a slightly different module in my child theme. In my child theme's functions.php, I have:

// Load Custom Divi Module
function divi_child_theme_setup() {
    if ( ! class_exists('ET_Builder_Module') ) {
        return;
    }
    get_template_part( 'includes/builder/module/AgriminStaff' );
}
add_action( 'et_builder_ready', 'divi_child_theme_setup', 9999 );

My AgriminStaff.php file is here. So far it's simply swapping the order of the Position and Name, and changing the position tag from a p to a h4.

In my child theme's includes folder, I have a file called widgets.php;

<?php
get_template_part( 'includes/builder/module/AgriminStaff' );

I receive no errors in the page builder, but the module 'Agrimin Staff' is not visible to be added to the page from the list of available modules.

Steps To Reproduce

See above

code-with-mehedi commented 3 years ago

Hello @SRD75,

Could you please follow this article? https://intercom.help/elegantthemes/en/articles/2865589-moving-contact-form-module-to-child-theme