From the course: WordPress: Custom Post Types and Taxonomies

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Building a basic custom post type

Building a basic custom post type - WordPress Tutorial

From the course: WordPress: Custom Post Types and Taxonomies

Start my 1-month free trial

Building a basic custom post type

- [Instructor] Now that our plugin is defined, let's go ahead and create our custom post type. First, we'll start with the basic definition of a custom post type, and then we'll move on to the settings and labels area. One note is that if you're using the same WordPress install that you used with Custom Post Types UI for your own plugin, you should deactivate Custom Post Types UI in order to avoid conflict. If you want to use it as a reference, make sure to grab that export or set up a completely different development site for the plugin and theme so we don't lose the work or avoid conflicts. The first thing we're going to do is in our lil-post-types plugin, we're going to create a new directory called post-types. This will be where all of our post types code is included. And inside that folder, we're going to create a new file called register. Now before we start adding code to register.php, we're going to go back to lil-post-types.php, and we're going to add this line to the end of…

Contents