Skip to content

Instantly share code, notes, and snippets.

@Garconis
Created March 2, 2018 17:35
Show Gist options
  • Save Garconis/a4d72e0bcfec4c36e8e8e33a2736f148 to your computer and use it in GitHub Desktop.
Save Garconis/a4d72e0bcfec4c36e8e8e33a2736f148 to your computer and use it in GitHub Desktop.
Divi | Add Divi Buildler and Divi Library to WordPress custom post types
<?php
function fs_et_builder_post_types( $post_types ) {
// the identifier of the post type
$post_types[] = 'your-cpt';
return $post_types;
}
add_filter( 'et_builder_post_types', 'fs_et_builder_post_types' );
// the code to make the Divi Library work is this:
add_filter( 'et_pb_show_all_layouts_built_for_post_type', 'fs_et_pb_show_all_layouts_built_for_post_type' );
function fs_et_pb_show_all_layouts_built_for_post_type() {
return 'page';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment