How To Create Custom Taxonomy In WordPress

It's only fair to share...Share on Facebook0Share on Google+0Tweet about this on Twitter0Share on LinkedIn0Pin on Pinterest0Digg thisShare on StumbleUpon0


What is Taxonomy in wordpress? Taxonomy is a wordpress feature to group content like posts. Tgas and categories are in-built taxonomy to group posts in WordPress. WordPress provide facilities to create our own custom taxonomies. So in this tutorial we are going to see about how to create custom taxonomy in WordPress.

Register Taxonomy:

register_taxonomy() is a function to add and register our own custom taxonomy in WordPress. So we need to hook this function to the init action in functions.php file.

So let suppose we have to create custom hierarchical taxonomy Brands then following is an example code for creating custom hierarchical taxonomy Brands. Slug option value will be used in url to access taxonomy posts.

We have added this taxonomy for posts,so you can see Brands under posts in WordPress menu. Now you can add taxonomy terms under this taxonomy to group posts.


By default your custom taxonomies use the archive.php template to display posts. You can create a custom archive display for these by creating taxonomy-{taxonomy-slug}.php template page.

Hope this tutorial will help you to create custom taxonomy in WordPress.

Reference :- 

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">