Divi Blog Module is a module in Divi where you can place your blog content anywhere in your WordPress website and in any format. Currently, it does not supports custom post type.
There are plugins to make it possible to use Divi Blog Module for Custom Post Type (CPT). One I found is Divi Custom Post Types, a specialist blog module for your CPTs. It cost $27.75 for a single site. I haven’t tried the plugin.
This how-to guide is to use Divi Blog Module for CPT without using such plugin. I used Custom Post Type UI plugin for creating CPT. I created Testimonial CPT with Testimonial category.
- Create Custom Post Type and check Categories (WP Core).
- Create and set Categories for your Custom Post Types.
- Add the code below to your child theme’s functions.php. Make sure to change
your_cpt
.add_action( 'pre_get_posts', function ( $q ) { if (!is_admin() && $q->is_category()) { $q->set( 'post_type', ['post', 'your_cpt'] ); } });
The code above is to include CPT’s category to the main query involving post type categories.
- Add blog module as usual and include only the category for your CPT.
Vikash
January 20, 2020 at 6:47 amgenius…Thanks for sharing brother.