Creating Custom taxonomy in WordPress – No Hard Work

 Creating Custom taxonomy in WordPress – No Hard Work

Custom taxonomy in WordPress is one of the most important things in a WordPress site if you do not want to get lost among thousands of content…

The categorization in WordPress is one of those things that everyone uses, but does not know that they are using it on. WordPress taxonomies are used as a way to group posts and custom post types together. WordPress has two common categories that people use on a regular basis: Categories and Tags.

What is a custom taxonomy in WordPress?

You can use custom taxonomy to create custom sets of content and bring them anywhere on the site at the same time.

For example, you have a custom post type called Hotels. Although you can use default taxonomies in posts in WordPress, you may not want to mix the two because they are used differently. You can register a new custom taxonomy called Sites. You can add site terms like: Germany, Italy, France, etc. This will allow you and your users to sort your hotel locations by each term.

The classifications can also be hierarchical in the sense that you can have major themes such as: Germany and France. Then you have a sub-site under each category eg Berlin under Germany and Paris under France and this is called and the child classification

hierarchical Taxonomy
hierarchical Taxonomy

Create custom taxonomy in WordPress using the . plugin

The first step to creating a custom taxonomy

Go to your WordPress Dashboard and click Plugins , then click Add New…. In the search form, type “PODS” and then click “Install” and then “Activate”.

Pods Plugin

After installing the plugin, you will see that Pods are displayed in Control Panel…

The second step to create a custom taxonomy in WordPress

Click on it then “Add new” then “ Create new d” then choose where the field content type is as custom label >> give a name and then click on next step…..

Creating Custom Taxonomies With a Plugin ....
Create custom labels using the…

The third step to create a custom taxonomy in WordPress

After the last step in the new rating control tab, go to the tab called “ Advanced ” and enable the post you want to set this rating on and click save….

Creating Custom Taxonomies With a Plugin step two with pods pluign wordpress 1024x502 1

Create custom taxonomy in wordpress without plugin

Now in this tutorial we need to write some PHP code in Functions.php file in WordPress theme

Go to Functions.php and paste the code

function wplearn_my_custom_taxonomy()
{
        $args = array(
        'labels'=> array(
                'name'=>'Locations',
                'singular_name'=>'Location',
        ),
        'public'=> true,
        'hierarchical'=> true,
    );
        register_taxonomy('funding-scholarship', array('post'), $args );
}
add_action('init','wplearn_my_custom_taxonomy');

That’s it, everything! Now check out the Post tab in your WordPress dashboard and see the new label called Sites there….

If you need help, just leave me a comment and I will totally help you

Maybe you would like to use Pods to create your custom article type as well, check out the full tutorial here