Created
March 2, 2018 17:35
-
-
Save Garconis/a4d72e0bcfec4c36e8e8e33a2736f148 to your computer and use it in GitHub Desktop.
Divi | Add Divi Buildler and Divi Library to WordPress custom post types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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