How To Create And Use Custom Post Types In Divi Tutorial by Pee Aye Creative

How To Create And Use Custom Post Types In Divi

This tutorial will show you how to create your own custom post types with our free generator and how to add and use them in your Divi website.

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.

Projects

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.

Products

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.

example of a custom post type in the Divi Theme Builder

Blog Module

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 Display Custom Post Types In The Divi Blog Module Tutorial by Pee-Aye Creative

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.

General

Name (singular)

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! 

Name (plural)

This is the plural form of the name.

Key

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.

Description

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.

Hierarchy

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.

Features

Supported Features:

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.

  • Title
  • Excerpt
  • Featured Image
  • Custom Fields
  • Revisions
  • Post Formats
  • WYSIWYG
  • Author
  • Trackbacks
  • Comments
  • Page Attributes

Taxonomies

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.

  • Categories
  • Tags

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.)

Labels

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.

Menu Icon

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.”

Visibility

This allows you to configure how you would like your post type to appear in the back end of WordPress.

Public

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.

Menu Position

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. 

Options

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.

Publicly Queryable

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.

Has Archive

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.

Capabilities

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.

Query Variable

This again is for advanced users. It allows you to control the query variable used to get posts of this type.

Rewrite Permalink

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.

10

Please share this post!

Nelson Lee Miller (aka The Divi Teacher)

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

Join Our NEW Divi Facebook Group!

The Divi Teacher Logo

Recent Posts

Leave A Response!

Subscribe
Notify of
guest
10 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Dave
29 days ago

Great tutorial on how to create custom types but why would one want to? A use-case would be helpful in understanding the purpose of custom type (beyond products, that is).

Gavin Fenton
28 days ago

Hi Nelson, great tutorial. If I need to add more custom fields to my cpt do I need a plugin like advanced custom fields or is there another way you’d recommend to add them and when I do how do I display them on my post and archive e.g. category tag and icons etc

Vera Schafer
Vera Schafer
25 days ago

Thank you for this much expected tutorial. Since I need my CPT to have its own set of categories, I wonder when the next tutorial about taxonomies will come up.

Vera Schäfer

Thank you!

Tony
25 days ago

Hi Nelson – great tool 🙂 I have created a CPT called ‘Documents’ and added categories for ‘Doctors’, ‘Nurses’ and Admin. When using the divi blog module I can filter by Documents, but the categories are not showing, so cannot filter further. Have I missed a step? Thanks

Victor
Victor
13 days ago

Thanks for a really nice tutorial! One question about the permalink structure part in the end: The URL for the archive is site.com/cats/ but the URL for a single cat post is site.com/cat/cat-name/ so I (or a search engine crawler) can’t go back in the structure by removing the last part of the permalink.
 
From a SEO and UX perspective, I would like the single cats to be under the archive structure, in this case site.com/cats/cat-name
 
How could I achieve that?

Shop Our Divi Products!

Child Themes • Plugins • Layouts

Visit The Shop

Divi Tutorials On YouTube

Subscribe to our helpful Divi videos!

Visit Our Channel

0
Would love your thoughts, please comment.x
()
x

Pin It on Pinterest

0

Your Cart