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

Building a basic custom taxonomy - WordPress Tutorial

From the course: WordPress: Custom Post Types and Taxonomies

Start my 1-month free trial

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

Contents