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 - WordPress Tutorial
From the course: WordPress: Custom Post Types and Taxonomies
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Creating your plugin3m 16s
-
(Locked)
Building a basic custom post type5m 37s
-
(Locked)
Customizing your post type labels4m 51s
-
(Locked)
Customizing your post type settings3m 13s
-
(Locked)
Activating the REST API on your post type1m 54s
-
(Locked)
Creating a post with your post type1m 56s
-
(Locked)
Challenge: Create an events post type1m
-
(Locked)
Solution: Create an events post type2m 21s
-
(Locked)
Extending post types with custom fields2m 14s
-
(Locked)
-
-
-
-
-