+91 9620 604 607 asif.bedif@gmail.com

Summary: Adding the PHP Snippet to Your Child Theme’s Functions.php File

php-snippet-paste

The first thing you need to do is copy the php code snippet below into your child theme’s functions.php file.

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

Next, find the name of the post type you’d like to add the Divi Builder to and replace the placeholder text “YOUR_CPT_HERE” and “ANOTHER_CPT_HERE” as you can see in the image above.

If you don’t know what the name of your post type is, then simply create a new post with it and look at the url. It will tell you what the name of that post type is. As you can see in the image below.

post-type-name-1

Bonus: Adding CSS For CPT UI Post Types

If, as I show you in the video, you have created a new custom post type using the Custom Post Type UI pluginyou will need the CSS below to paste into your custom CSS panel under Divi > Theme Options > Custom CSS. This will allow your new custom post type builder content to display properly.

/*Replace “POST_TYPE” with the slug for your new CPT created with CPTUI.
___________________________________________________________*/
.et_pb_pagebuilder_layout.single-POST_TYPE #page-container .et_pb_row {
width100%;
}
.et_pb_pagebuilder_layout.single-POST_TYPE #page-container .et_pb_with_background .et_pb_row {
width80%;
}

What Should We Cover Next?

That’s all for this episode of Divi Nation, but there’s a lot more Divi content on the way in our Divi 100 series. If you have a request for a specific Divi tip or tutorial leave it for us in the comments section below!

À propos de asifbedif

Généralement, on utilise un texte en faux latin (le texte ne veut rien dire, il a été modifié), le Lorem ipsum ou Lipsum, qui permet donc de faire office de texte d'attente. L'avantage de le mettre en latin est que l'opérateur sait au premier coup d'oeil que la page contenant ces lignes n'est pas valide, et surtout l'attention du client n'est pas dérangée par le contenu, il demeure concentré seulement sur l'aspect graphique.

Partager sur les réseaux sociaux
Main menu