Enable the Divi Builder for Custom Post Types
Makes the Divi Builder available on the custom post types you list, such as portfolios, case studies or courses, even when they are not ticked in Divi's settings.
Opens WPIDE on
Code
// Post types that should get the Divi Builder.
$wpide_divi_post_types = array( 'portfolio', 'case_study' );
add_filter( 'et_builder_post_types', function ( $post_types ) use ( $wpide_divi_post_types ) {
foreach ( $wpide_divi_post_types as $type ) {
if ( post_type_exists( $type ) && ! in_array( $type, $post_types, true ) ) {
$post_types[] = $type;
}
}
return $post_types;
} );
Notes
Use post type slugs. The post type must support the editor.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.