Activate Divi Builder in WooCommerce and Any Custom Post Type

If you use the Divi template you will see that only the Divi Builder appears in the posts and pages.

If you use WooCommerce you will see that when you create a product the possibility of using it does not appear, but do not worry in this tutorial we will see how to activate it to use it in WooCommerce products and in any other type of WordPress content.

Activate Divi Builder in WooCommerce and Any Custom Post Type

To follow the tutorial you need the DIVI template, you can buy it from here or if you are a premium member You have it available for free in the members area.

Here is the video tutorial:

Subscribe to my channel:

[wps_button style=»default» url=»https://comohacerunapagina.es/ir/divi-20″ target=»blank» background=»#8224e3″ color=»#ffffff» size=»18″ icon=»star » wide=»yes» position=»left» radius=»auto» text_shadow=»0px 0px 0px #000″ rel=»nofollow» title=»Default Button» id=»default-button»]BUY DIVI WITH 10% OFF DISCOUNT[/wps_button]

Before following the tutorial remember to make a backup

In order to activate Divi Builder we are going to add the following code in the functions.php file of our template.

I recommend that instead of doing it directly in the Divi template, you use a Divi child theme

We add the following code to the functions.php file

function my_et_builder_post_types( $post_types ) {
    $post_types[] = 'product';
    return $post_types;
}
add_filter( 'et_builder_post_types', 'my_et_builder_post_types' );

The above code is prepared for the Divi builder to appear in WooCommerce products.

We have to add the following line changing the content type for the one we need:

$post_types[] = 'product';

Where 'product' is the content type.

To know the name of the content type, we are only going to create a new product and look at the url:

woocommerce content type

We add as many lines as types of content we want the Divi Builder to have.

Activate library presets in customs post types

Although we have activated the Divi constructor, if we want to load a predefined design in a WooCommerce product or any other type of content that we have added, we will see that it comes out empty.

To activate the possibility of using them we have to add the following function in the functions.php file:

function myprefix_et_pb_show_all_layouts_built_for_post_type() {
    return 'page';
}

add_filter( 'et_pb_show_all_layouts_built_for_post_type', 'myprefix_et_pb_show_all_layouts_built_for_post_type' );

And in this way you can now use Divi in ​​the products of your store without problems 😉

[wps_button style=»default» url=»https://comohacerunapagina.es/ir/divi-20″ target=»blank» background=»#8224e3″ color=»#ffffff» size=»18″ icon=»star » wide=»yes» position=»left» radius=»auto» text_shadow=»0px 0px 0px #000″ rel=»nofollow» title=»Default Button» id=»default-button»]BUY DIVI WITH 10% OFF DISCOUNT[/wps_button]

2 comments on “Activate the Divi Builder in WooCommerce and Any Custom Post Type”

Leave a comment