‫Welcome back, my dear students.
‫And now in this lecture of the course, we're going to be adding our own custom taxonomy.
‫So as you can see that in this particular section, we are actually building a blog website based on
‫the travel blog.
‫Now on a travel blog, ask yourself what is the main and the most important thing?
‫Are those the categories?
‫Those are actually not the categories because people are not visiting your website.
‫Like if they like your website, they will land on the website for the first time by searching on the
‫Google for any of the keyword.
‫And now let's suppose that they like your website.
‫So once they have liked your website and now they want to revisit it it then they will be visiting by
‫typing in the URL.
‫But now let's suppose that they want to, uh, like uh, categorize or they want to differentiate the
‫post based on what?
‫Based on what is the main and the most important thing that they will be differentiating the post based
‫on.
‫And that is going to be the destination.
‫So like all of the countries you have been to, you can categorize the post based on the destination,
‫not the activities, not the itinerary.
‫Like if you have added it, it's good.
‫It's good to add them in the categories.
‫It's good for the SEO.
‫You can add these categories in a menu in a dropdown menu, and people can navigate these activities,
‫itinerary stays and everything.
‫But the main and the most important thing is going to be the destination.
‫However, if you take a look at this WordPress now WordPress has the default two taxonomies.
‫The number one is a category and the other one is a tag.
‫The only difference between the categories and tag is like the categories are the main categorization.
‫The tags are like unlimited.
‫Like if you want to add so many number of the tags, you can add it.
‫There's no need to worry.
‫And there is also not a parent child relationship in the tags as well.
‫However, in the category there is a parent child relationship like inside the stays.
‫We've got Airbnb and hotel.
‫So like if someone wants to take a look at all of the stays on my blog, then he can just click on view
‫and all of this stays like whether it's related to the Airbnb or whether it's related to the hotel,
‫all will be shown over here.
‫Like, you can see that this is actually in a hotel category, but this is being shown in this day because,
‫um, the hotel is actually a child category of this day.
‫So this is how it's going to work.
‫But the main and the most important thing, like why people are actually visiting your blog, is the
‫destination.
‫Now, this is specifically related to the travel blog.
‫If you want to build any type of other blog, then like, uh, do some of the paperwork and see why
‫people are actually visiting your website and what are the things you want to add it in the menu.
‫So the best reason to do it is that you can Google like top travel blogs or top whatever kind of blog
‫you want to build, and then take a look at some of the most popular blogs.
‫Like you can see that I have got, uh, some of the list of the blogs, uh, that I have over here.
‫We have got adventurous Kate.
‫You can see that the destination is over here so that people can actually go into the destination.
‫They can select their own destination.
‫And based on that, all of the posts will be shown.
‫Similarly, we have got another right here.
‫This as you can see that this also contains the destination.
‫Then this is also got the lifestyle and everything you can add it.
‫It's up to you if you want to add it.
‫Like as your blog grows and you want to actually like, uh, promote your hotel, like if you have started
‫your own hotel or you want to, or you are actually affiliated with, uh, a luggage brand and you want
‫to promote that, then you can also like, uh, add a category like travel gears and you can add all
‫of the list like that.
‫So, so you are getting what I actually mean, right?
‫Then we have got the travel freak.
‫You can see we have got the travel gear like this is right here.
‫But this guy also has a destinations over here.
‫And the person can select like if that person wants to visit the Europe then you can click on that.
‫And all of the posts that are based on the Europe will be shown to me like this.
‫So we want to do something like this so that the person can actually just go into the destination,
‫select their country, and all of the posts will be shown.
‫Similarly, we've got a luxury travel blog where we've got the travel articles.
‫And this, as you can see, the.
‫Let's suppose that if I want to select the Europe, then all of the posts based on the Europe will be
‫shown to me.
‫Now this guy is actually using the category, but it is not recommended to use the category.
‫It's recommended to actually create your own separate category, not add the Europe in a category like
‫this.
‫All right, the categories are meant for the category, but if you want to add any different category
‫like destination which can be defined as a category, then you have to create it yourself inside the
‫WordPress.
‫Then we have got the Bald Hiker, which is also a most popular blog.
‫And you can see that this guy has also the destinations over here.
‫So now let's just go ahead and let's create our own custom taxonomy named as a destination.
‫Now you can do it for your own blog.
‫If you want to build a different blog, you can do it.
‫You can just like, uh, think of it, what is going to be your other custom taxonomy and you can add
‫it.
‫So let's just go ahead and let's add our custom taxonomy.
‫Now to add a custom taxonomy, what you need is to install a plugin.
‫And that plugin is really simple.
‫All you have to do is to go into the plugins, and then you have to click on Add new plugin.
‫Once you are in here, then you have to search for CPT UI.
‫That's it.
‫Then you have to hit on enter and you can see that we've got this custom post type UI which is over
‫here.
‫Now you can use this plugin or this plugin.
‫It's up to you.
‫However we're going to be using this particular plugin.
‫Uh, in this particular section.
‫And then we're going to be moving up with the other plugins later on in the upcoming sections.
‫So first just go with this CPT UI by Web Dev Studios.
‫And then you have to click on install.
‫So once this plugin is actually installed now you can go ahead and you can hit on activate.
‫And now you can see that this particular plugin is now activated.
‫Now this plugin is really very simple.
‫It's really, uh, lightweight.
‫And you do not have to do particular things.
‫So the very, uh, main and the most important thing is that we want to actually add a taxonomy.
‫And that is why we have to go into the CPT UI.
‫And then we have to click on add slash edit taxonomies.
‫We do not have to add a post type.
‫This is something that we will be doing in the fifth project of this course.
‫But for this project we're going to be working with the add slash edit.
‫All right.
‫Now let's just go ahead and let's click on Add Slash edit.
‫Now this is actually the taxonomy slug which means that what is going to be the URL like let me show
‫you.
‫So if I just open up this particular luxury travel blog now you can see that if I just want to visit,
‫like if I want to visit the Asia, I select this all of the, uh, we are actually in the Asian country
‫over here now.
‫It's actually slash category slash region slash Asia.
‫So I not wanted this.
‫Like if I want to add a destination then I want to add it like my domain name.com/destination/the destination
‫name.
‫Like if I want to add the state as well.
‫Like it's going to be slash destination slash Asia and then slash uh, China.
‫So this is how I want to go with it.
‫So for that what you need to do is to enter whatever, uh, the name that you want to add, which is
‫going to be your domain name.com/destination.
‫So I want to add in here destination.
‫Once you have added that then you have to select the uh plural label.
‫So we're going to be adding destinations.
‫And you now have to add the singular label.
‫Which is going to be the destination.
‫Now after that it shows me attach to post type like which of the post type do you want to assign it?
‫So I actually want to assign this to the post that I will be adding for my blog website.
‫So I want to attach it to the post.
‫I will select this.
‫That's it.
‫Now you do not have to click on Add Taxonomy.
‫Right now you have to go down.
‫Go down or let me just go ahead and let me first add the taxonomy and then we will see the difference.
‫All right.
‫So now you can see that I have actually added the taxonomy.
‫Now once this destination is actually added.
‫Now, if you go into the post and if you bring your mouse, you can see that we've got this destinations.
‫And now if you click on it, you can see it says no tags found because this destination is added as
‫a tag.
‫Now, since inside this destination, I want this destination to have the parent child relationships.
‫Like.
‫Let's suppose that if I want to add, uh, like China, then I want to also add the parent category
‫of the China as well, which is going to be Asia.
‫Or if I want to add the Dubai, then I want to also add the parent category of the Dubai, which is
‫going to be United Arab Emirates.
‫So this is how I want it to go.
‫Based on the tags, there is no option to actually, um, use the parent child relationships like we
‫did in the category.
‫Like if we click on the category, you can see that we have got the parent category or we want to show
‫the parent destination.
‫All right.
‫So that is why we need to allow it to be working as a category and not the tag.
‫All right.
‫So what you need to do for that you need to click on this, uh, CPT UI again.
‫So let me just go ahead and let me uh right click on this add edit taxonomies and I will open this up
‫in a new tab.
‫And now once I am in here now I do not have to add a new taxonomy.
‫I actually want to edit the taxonomy.
‫So I will click on here.
‫I will select the destinations that I, uh, added in the previously right here.
‫And now I will go down.
‫So once you go down down down down then you have to select hierarchical.
‫Here it is hierarchical.
‫What you need to do is to just select this.
‫And then you have to click on true.
‫That's it.
‫After that you need to go down.
‫And then you have to click on save.
‫Taxonomy.
‫That's it.
‫Once this is saved, now if you go into the post and then if you click on this destinations now you
‫can see it says no categories found.
‫And we've got the parent destination which was not being shown.
‫So now let me just go ahead and let me quickly add some of the continents or the states.
‫And then um, we'll be moving forward.
‫And we're going to be also adding some of the child countries inside that state as well.
‫So let's suppose that I want to add America.
‫Which is added now I want to add Asia.
‫I want to add the Europe.
‫And I want to add the Middle East.
‫Currently, let's suppose that these are the continents I will be visiting.
‫All right.
‫And once I have actually added these destinations, now I want to add the child destinations like inside
‫the Middle East.
‫I want to select this Middle East and inside this Middle East we have got Dubai or sorry, it should
‫be United Arab.
‫Emirates.
‫Similarly, we've got Qatar and we've also got Saudi Arabia.
‫Now let's take a look at the IRB.
‫So in the IRB we have got like Germany.
‫Italy.
‫And Paris.
‫So let's suppose that I have actually visited these three countries in Europe only.
‫And then we have got the Asia.
‫So we can write here Indonesia.
‫And we have got.
‫Malaysia.
‫And Turkey.
‫I don't know if this turkey is actually in the Europe or in the Asia, but I do believe that most of
‫the Turkish side is actually in the Asia.
‫So let's just add this, uh, Turkey in the Asia.
‫All right.
‫And now I will hit on enter and this will be also added.
‫Now we've got the America.
‫So for the America, let's suppose.
‫Then I want to add Chicago or no, I don't think Chicago should be inside the America.
‫So I'm going to delete this.
‫Inside the America.
‫I think it should be.
‫Um.
‫Illinois.
‫Illinois first, and then inside under the Illinois.
‫So I'll be selecting this.
‫This is actually a state.
‫And now I'll be adding the Chicago.
‫So this is how you can go ahead and you can add the parent child relationships, and you can go dive
‫deeper into it.
‫Like let's suppose that we've got the Middle East, which is a state, uh, UAE comes under that.
‫And then after the UAE.
‫Let's suppose that I want to add to by.
‫And I also want to add the Abu Dhabi.
‫So this is how it's going to be.
‫Now, if I will visit this Middle East, then all of the posts that will be in the Saudi Arabia, Qatar,
‫UAE, Abu Dhabi, Dubai, all of the posts will be shown to me.
‫If I visit Dubai, only Dubai post will be shown to me.
‫If I visit UAE, then Abu Dhabi and Dubai post will be shown to me.
‫So this is how it's going to be worked.
‫Like as you will be going deeper, deeper, deeper, it's going to be like that.
‫So now we have actually added some of the destinations.
‫Now let's just go ahead and let's assign these destinations.
‫So now what I'll be doing is that I'll be going into the all post.
‫And now I've got this ten days Dubai budget itinerary.
‫So I'll be clicking on edit.
‫And now if I go down you can see that now I've got this destination.
‫And if I click on it I've got all of the destinations being shown over here.
‫So now what I'll be doing inside the Middle East.
‫We have got the UAE then inside the UAE we've got the Dubai.
‫So I'll be selecting this and now I'll be clicking on update.
‫That's it.
‫Now I'll be clicking on all post again this Burj Khalifa since this is also in Dubai.
‫So I'll be clicking on edit over here.
‫And now in the destination I'll be selecting the Dubai over here.
‫And now I'll be clicking on update.
‫Now let's assign this Hello World to a destination as well.
‫So let's suppose I'll be clicking on edit.
‫And this one is we're going to be adding it into.
‫Let's suppose that we want to add it in the Chicago.
‫All right.
‫And we will be hitting on update.
‫Now if I just go ahead and if I click on the destinations now you can see that we've got the America.
‫And inside the America we have got a state and we've got a city.
‫And inside this city we have got a post.
‫Now if I will view the city Chicago, then all of the post that will be in the Chicago will be shown
‫to me like, let's suppose a 22 best things you should visit, uh, you should do in Chicago.
‫All of the posts like imagine this, this is how it's going to be shown.
‫Like, let me show you the travel blog.
‫So this is the one.
‫You can see that the category will be shown over here, like uh, Chicago and all of the post will be
‫shown to me like this.
‫Similarly, now let's suppose that if the person wants to visit the America and he wants to view all
‫of the posts based on this particular main category, then he will be viewing the main category, which
‫is going to be the America and the hello world will still be shown, which is in the Chicago.
‫But since this Chicago is actually the child category or the child destination of the America, that
‫is why it's being shown.
‫Similarly, if we actually view this Middle East now inside the Middle East, we have got the, uh,
‫UAE and inside the UAE we have got Dubai.
‫So either I view the Dubai, the Dubai is over here.
‫All of the post regarding the Dubai will be shown.
‫Instead of the Dubai if I visit the Middle East or if I visit the UAE, then you can see that the Middle
‫East also has this Dubai post and the UAE also has this Dubai post.
‫So the reason for that is because there is the parent child relationship, because inside the Middle
‫East we have got the UAE and then we have got it Dubai.
‫So if you go upwards, all of the post inside there will be shown to you like that.
‫So these are actually the destinations and everything that I have added.
‫And now what I would recommend you to do is to add some of the post to your blog.
‫Like you can see that we have got the categories and the destinations.
‫Now I want you to at least add 2 to 3 posts inside each of the cities that we have or the countries
‫that we have added over here.
‫And once you have added it, then it's going to be really much, uh, easier for us to design our,
‫uh, blog website.
‫So do that.
‫And once you're done with that, then you can actually watch the next lecture.