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.
Solution: Make location taxonomy - WordPress Tutorial
From the course: WordPress: Custom Post Types and Taxonomies
Solution: Make location taxonomy
(upbeat music) - [Instructor] Now that you've created a location taxonomy, let's take a look at how I would do it. Since we have our register size taxonomy function here, we're going to copy that and use it a boiler plate for our location taxonomy. We'll go ahead and paste that right into the register.php file inside our taxonomies folder. Then we'll rename this function to lil_register_location_taxonomy. We'll change the labels. So we'll change Sizes to Locations, we'll change Size to Location, and we'll change Add New Size to Add New Location. In the args is where it gets a little tricker because we want this taxonomy to be hierarchal. So the first thing we'll need to do is add the hierarchical key and we'll set that to true, it is false by default. And then we'll also set our rewrite rules. Because we are making this a hierarchical taxonomy we want to make sure we have the appropriate rewrite structure in place, so we'll set this array and there are two keys we're going to set…
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)
-
-
-
-