What Is A Custom Post Type
Pages and Posts are considered post types in WordPress, but we can also add our own custom post types. This will help you classify your content better and more seamlessly. A custom post type allows you to go beyond pages and posts and contain whatever type of content you would like based on your needs.
With our free generator, you can create your own custom post types in Divi and name them whatever you want. A custom post type can even have its own menu item in the WordPress dashboard for easy access, just like pages and posts.
When you install Divi, it comes with it’s own custom post type. I don’t know why they do this, but I guess it is there simply to show how a custom post type can be used and how it can interact with the Divi Theme and Builder.
Projects are used to create a portfolio, and you can use the Portfolio or Filterable Portfolio Modules to display those project post types on a page.
You can build the actual project page with Divi.
Another custom post type that you may be familiar with is Products. This post type is created by Woocommerce. Products are their own post types with their own attributes and can have their own categories.
By default, Divi has built-in integration with WooCommerce, and comes with a great selection of Divi modules. You can build out the entire product page for example using Divi. All you have to do is enable the Divi Builder on products and you can build the layout however you want.
How To Use Custom Post Types In Divi
The big question remains. How do you use a custom post type in Divi? Thankfully Divi makes it super easy to integrate custom post types, and there are two main areas that have seamless integration with Divi.
Enable Divi Builder On Post Types
To enable the Divi Builder on post types, just go to Divi>Theme Options>Builder and you will land on the Post Type Integration tab. Then under Enable Divi Builder On Post Types you can toggle on or off the Divi Builder support for any post type.
Theme Builder Support
Another really great custom post type integration with Divi is in the Theme Builder. When you go to Divi>Theme Builder and assign a template, you can choose to assign a template to the custom post type pages just like any other post type.
You can display an archive of your custom post types in Divi in the blog module. Be sure to check out our tutorial on how to use custom post types in the Divi blog module.
How To Create A Custom Post Type In Divi
There are at least two ways to make a custom post type. You basically can choose to use a plugin, use a generator, or hire a developer.
Use A Plugin
If you want to use a plugin, you could check out Custom Post Type UI, Pods, or another similar plugin. These plugins provide an interface for you to enter the data. Just remember, this is not automatic, but manual. Just because it is a plugin does not mean it is easier. I honestly think our generator is easier.
Use A Generator (Recommended)
You may think that a plugin will be easier, but I disagree. You will end up following the same steps here as in a plugin, so you may as well have one less plugin on your site! Besides, learning is good for you and this will be fun! And our generator auto-populates the fields, which is super cool! You can access our custom post type generator for free.
How To Use Our Free Divi Custom Post Type Generator
As we said before, we have a new free resource on our website! You can now generate custom post types using our generator, which also works for custom taxonomies (which we will talk about in the next tutorial).
If you haven’t yet, be sure to keep our Custom Post Type Generator open in a new tab as we go along.
The rest of this post will be an explanation of each of the features of the generator. I’ll do my best to break it down into simple language.
This is the singular name you want to call your custom post type.
Notice that when you type the name into the field, most of the other fields in the generator under the General and Labels sections auto-populalate!
This is the plural form of the name.
This is the main value that the code uses to reference the custom post type. This is usually a singular small case version of the name. This needs to be one word without any dashes or underscores.
This is the description of the post type that may be useful in rare cases on an archive page. You might want to say what it does and why you are using it.
A hierarchical post type can have a parent and one or more children. The pages post type in WordPress is a good example of a hierarchical post type. One page can be the parent of other pages, that can be parents of other pages in a hierarchical fashion.
Below is a list of the options you can choose to select based on your needs. Any item you select will be included. I’m not going to explain each of these since they are mostly self-explanatory. These are the fields that will be available on the custom post type, similar to how pages and posts.
- Featured Image
- Custom Fields
- Post Formats
- Page Attributes
You can choose to use the same categories and tags to organize your custom post types that you use for posts. Note that this will not give the new post type its own categories and tags. To do that, you would need to create custom taxonomies.
Besides categories and tags, you can also add your own taxonomies. Make sure the value or values you enter here match the “key” when you use the other tab to make the custom taxonomies. (Our guide on custom taxonomies will be linked here as soon as it is posted.)
This allows you to configure how each of the post types labels will appear. If you want to see this in action, just browse around your site and look at how this works for pages and posts. Our generator will add these automatically, but you can edit them as needed.
The menu icon is the icon that shows up in the WordPress dashboard. As an example you can see that Posts uses a thumbtack icon. You can choose an icon from the list of WordPress dashicons avaible at this page. Then once you have selected an icon, enter the icon name into the input field, such as “dashicons-admin-post.”
This allows you to configure how you would like your post type to appear in the back end of WordPress.
This option changes the visibility of the WordPress custom post type to authors and visitors. Just keep this set to True to make it appear in the WordPress Dashboard.
Show in Navigation Menus
This sets whether the new custom post type items will be available in the WordPress navigation menus. Most likely you would want to to be set to True.
Show Admin UI
This determines where the custom post type is shown in places like the “+New” menu at the top of the WordPress back end. This should be set to True.
Show in Admin Menu
This determines where the custom post type is shown in the WordPress admin menu. This should be set to True.
This determines the position of the new custom post type name in the WordPress admin area navigation menu in relation ot the other default items that are there. You can select any option you want from the dropdown.
This allows you to configure how you would like your post type to appear in the back end of WordPress. These settings are more for advanced users and developers, so you can usually leave them on the default setting.
This is more of an advanced technical setting that determines whether queries for this post type can be performed from the front end. Just leave this set to True.
Exclude From Search
This setting is where you get to choose whether the new custom post type should appear in search results. So if someone uses a search widget or search module on your site, you can decided if you want to show your new post type in the search results.
This setting allows you to choose whether or not the custom post type will have a main archive page like https://yourdomain.com/custom-post-type/. Don’t foreget, you can use the Divi Theme Builder to design the archive page!
Export via WordPress Import/Export Tool
Use this setting to decide whether posts belonging to your custom post type can be exportable via the WordPress export tool.
This again is a technical setting, but basically it has to do with the ability of certain user roles to perform certain actions, like delete or edit posts. Most users can keep this set to Post.
This again is for advanced users. It allows you to control the query variable used to get posts of this type. This cannot be the same value as the key.
This advanced setting allows you to define the permalink structure of your posts when viewing the single post. For example, you may want to have a structure like www.yourdomain.com/something/custom-post-name. WordPress will set up a default structure based on your taxonomy name.
There you go! That’s how you can use our free generator to use custom post types in Divi. Be sure to watch the video above.
If you want to take this further, we have a lesson on custom post types and more in our Beyond The Builder course, so consider purchasing that if you build or manage websites with Divi and WordPress.