How To Display Custom Post Types In The Divi Blog Module Tutorial by Pee-Aye Creative

How To Display Custom Post Types In The Divi Blog Module

You can now display custom post types in the Divi Blog Module! This is an exciting new feature that snuck in there in Divi 4.0.
Categories: Divi Blog Tutorials

Any Custom Post Type Now Shows In The Divi Blog Module

We’ve tested this with a variety of different post types, and it works great. We even tried the project post type that ships with Divi, as well as products from WooCommerce. Of course there are some disadvantages to using the Blog Module to display products, but hey, it could be useful. Here are the custom post types we tested with the Divi blog module:

  • Posts
  • Pages
  • Projects
  • Products
  • Custom
Custom Post Type UI with Divi

Once this plugin is installed and activated, a new menu item appears in your Dashboard called “CPT UI.” From there, you can add or edit post types. I’m not going to show you all the steps here in this tutorial (we’ll save that for another time if you are interested), but we can show you the basics. Our goal in this post is simply to show you how to display custom post types in the Divi Blog module, not to create and manage them.

Below you can see the settings to add a new post type.This is what I used for our demo. I decided to use “Cats” as my custom post type.

Adding a new custom post type to Divi
custom post types in Divi

After the custom post type is created and a few items have been added, go to the page where you want to display the post type feed and add a blog module. As of Divi 4.0, a new option appears under the Content toggle called “Post Type.” This is a dropdown showing all the available post types for this website. As you can see, from our example, there are several available in my example site:

  • Posts (which was the only one we had previously),
  • Pages
  • Media
  • Projects
  • Products (since I have WooCommerce installed)
  • Cats (the new CPT we just created)
select and display custom post type in the Divi blog module
select from any custom post type in the Divi blog module
example of a custom post type being displayed in the Divi blog module

When I click the Cats from the post type selector, it displays everything in the Divi blog module just like it did for posts prior to Divi 4.0. You can choose the layout, hide or show elements, and style everything using the Divi Builder.

I’ really excited about this and some of the other new features in Divi, so be sure to follow the blog closely as I will be showcasing more and more features that you may have missed. We will also be creating some child themes using custom post types, so that is excited that this functionality has been added. Let us know in the comments how you are using custom post types in the Divi blog module!

28

Last updated Jan 3, 2021 @ 1:34 pm

Please share this post!

Nelson Lee Miller (aka The Divi Teacher)

Nelson is the owner of Pee-Aye Creative in the beautiful state of Pennsylvania. He loves helping small businesses, exploring outdoors, building websites with Divi, and teaching others.

Leave A Response!

By commenting you agree to our Blog & YouTube Comments Policy

31 Comments

  1. noureena

    how can i add categories of a custom post type in divi blog module

    Reply
      • Thais

        I need to do that too! There is no way?! 🙁

      • Nelson Lee Miller (aka The Divi Teacher)

        This is a new feature, so I’m sure this will be added at some point. I’d suggest sending this in to Elegant Themes for consideration!

  2. Tajin

    Sadly they did only half the job and didn’t bother adding the same functionality to the post-slider module.

    Reply
      • Avinash

        It’s been a year, still no option to choose custom category in the post slider or image slider. I hope divi comes up with it,

  3. Tine Broucke

    Hi, I guess I have the same question as the ‘catogory’-problem.
    In the ‘cat’-‘dog’ situation, I’ve made a CPT with cats, but I only want to show the ones with green eyes (which is provided from a radiobutton-choice). Can I do that? Or do I have to show all the cats?
     
    Kind regards
    Tine

    Reply
    • Nelson Lee Miller (aka The Divi Teacher)

      Hi Tine,
      I assume you are referring to the taxonomies not being shown in the Blog module for CPTs. What you describe is a search and filter effect, which I believe there are WordPress plugins for that. My friend is releasing one for Divi here in June 2020, but you may also look at Search and Filter plugin.

      Reply
      • Kalle

        Any updates on this? Would love to use this functionality! I want to show cities only from a certain country (using CPT UI and ACF). /Kalle

      • Kalle

        Thanks for the response! I think I figured out a solution. I now have an issue where I cannot find one the custom post types. Have you had this issue?

      • Brad

        Can I ask what your solution was, please?

  4. Nathan

    Do you know if there is a way to show regular posts and also custom post types in the same feed? My clients site has hundreds of posts and we now also want to create new custom post types, but want them in the same feed.

    Reply
    • Nelson Lee Miller (aka The Divi Teacher)

      Interesting, I don’t know of any way to do that with the Blog module, but I’m sure there would be a WordPress specific plugin (not Divi) for that.

      Reply
  5. Abhishek Kotian

    how can i create custom post type current category page. similar as the post types current category.

    when i can it to custom post types name in the selection column the category check box doesn’t display for the custom post type.

    Reply
  6. Jacob Reinholdt

    Great post.Thank you. I do not read the divi change log (yet) – so it is great that you post about changes and new features in DIVI, Miller. I am experimenting with use Custom Post types on one of my projects.

    Reply
  7. John Callanan

    Still can’t display by Category though? Kind of half-baked feature IMHO. ET should complete this.

    Reply
    • Mark Cunzolo

      Hi there, here is a “fix” I discovered. For your CPT, you HAVE to enable WP core categories. For blog module selective filtering, you’ll need to create categories for your CPT, rather than custom taxonomies. Then, when you add the blog module to your page, the categories you set for your CPT will show up in the categories listed for posts, which is the default content option for the blog module. Leave it on posts and check off the categories you want to show, even though these categories are assigned to your CPT instances and not any of your out-of-the-box posts. Once those categories are checked, change the dropdown from posts to your CPT. Immediately, you’ll notice that only your CPTs with those categories load in. If you switch back to including posts, you’ll see that Divi keeps the checked category options you made rather than clearing them. So, once you check them and change over to pulling in your CPT, the checked categories stay checked and Divi’s logic still pulls based on them AND your CPT. It stinks that you can’t pull in custom taxonomy yet, but this is a workaround.

      Also, I agree that this is half-baked and is becoming kind of their MO. It seems like ET is more concerned with saying they have the most features but not with revisiting existing features and making them stellar. For instance, Elementor’s form module can tie directly into Mailchimp AND allows you to add people to lists, groups, and tags. Why doesn’t Elegant Themes go back to their form module and add functionality like this? I’m worried that they are relying too much on the marketplace now. Instead of improving their theme, they just point you to 3rd party developers who are coming up with solutions. I LOVE THAT PEOPLE ARE COMING UP WITH SOLUTIONS, but ET should also be improving and adding features that are to be expected.

      Reply
    • Mark Cunzolo

      Hey there, This is actually Mark Cunzolo again. I submitted what I thought was a fix, then I tried to go back and edit it before it was approved because I realized my fix didn’t work. BUT NOW I HAVE A CODE WORKAROUND THAT IS WORKING!

      Okay, again you need to allow WP core categories to be active on your CPT. I know you want to use custom taxonomies, but until ET comes out with a fix/addition you’ll have to use regular old categories for your CPT. Then, add the snippet of code discussed in this article to your functions.php file in your child theme:

      https://tutorial.blackandblue.tech/wordpress/divi/how-to-use-divi-blog-module-for-custom-post-type/

      Just be sure to replace “your_cpt” in the code snippet with the correct name of your CPT. After saving that, go back to the page you’re working on with the blog module. WHEN YOU OPEN UP THE MODULE, MAKE SURE THE POST TYPE IS SET TO POSTS, rather than to your custom post. Then select the categories associated with your CPT. On the backend/frontend visual builder, it will look like it doesn’t work as it will just show that nothing was found. HOWEVER, if you save the page and then go look at it on the actual front end browser, it will now load your CPT with those categories. So, it works on the real front end, just not in the builder. You can just design by selecting your CPT in the blog module first. Then when you are done styling, switch over to posts, save, and your desired CPTs will load on the real front end.

      WOW! So happy to get this working. Let me know if this works for you.

      Reply
      • Lucien Portugal

        Hey, I just tried the solution you shared and it works great! Thank you so much for taking the time to share a fix/workaround to this (annoying) issue.

        Very useful and very much appreciated!

        Hopefully Elegant Themes spend some time improving past features like this and implementing better CPT and category/taxonomy support and customization for the blog module. I’ll make sure to request that they do.

        Thanks again!

      • Meerah

        THANK YOU MARK! I have been looking for this solution for hours. You just made my day!

  8. Kunle Ajayi

    Wow…short and precise. I love this

    Reply
  9. Zac

    Do you have a tutorial on adding Project Post types to the Divi Post Slider?

    Reply
  10. Joe

    Wow! I just discovered this and it will make a huge difference on one of the sites I designed for a client. I can now get rid of the loop injector that I was using to create custom layouts for special content types. Thanks for mentioning this in this article Nelson and confirming that it “snuck” in with version 4. I wondered if I was going bonkers for not seeing it before.

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Asset 7

Shop Our Divi Products

Plugins • Courses • Templates

Visit The Shop

Divi Tutorials On YouTube

Our videos have views! Join subscribers and enjoy over video tutorials!

Visit Our Channel

Recent Posts

Pin It on Pinterest

0

Your Cart