# 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.

- Type: PHP
- Runs: Run everywhere
- Category: [Page Builders & Themes](https://wpide.com/library/category/page-builders/)
- Tags: divi, post-types, editor
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/divi-builder-custom-post-types/

## Code

```php
// 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 use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Enable the Divi Builder for Custom Post Types" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
