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 taxonomy - WordPress Tutorial
From the course: WordPress: Custom Post Types and Taxonomies
Building a basic custom taxonomy
- [Instructor] Now that we have some custom post types, let's create a custom taxonomy to organize them. First, we'll get the basic definition of the taxonomy down, and then we'll move on to the more advanced customizable settings. In our plugin lil-post-types, we're going to create a new directory called taxonomies, and inside that folder, we're going to create a new file called register.php. In lil-post-types.php, we're going to use the require_once function to grab that register file. So I'm going to copy the require_once that we're using to pull in our post types, I'll add a couple of lines to the end of the file, I will paste that line, and then I will change post-types to taxonomies. Then we'll save that. Back in our register file, I'm first going to do the opening PHP tag, and then we're going to create a function to register our size taxonomy. So we'll call that function lil underscore register underscore size underscore taxonomy. And this is where we will define our taxonomy.…
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)
Building a basic custom taxonomy4m 14s
-
(Locked)
Creating an advanced custom taxonomy2m 50s
-
(Locked)
Activating the REST API for your taxonomy1m 17s
-
(Locked)
Adding taxonomy terms to your post types1m 43s
-
(Locked)
Challenge: Make location taxonomy1m 13s
-
(Locked)
Solution: Make location taxonomy3m 10s
-
(Locked)
-
-
-
-