...
Tutorials, Wordpress

How to create custom tags for custom post type in wordpress?

18 February 2019

If you need to create custom tags for custom post types, here’s what you need to do to add/allow “custom tags” to your custom post types in WordPress.

Example :

//register taxonomy for custom post tags
register_taxonomy( 
'custom-tag', //taxonomy 
'my-custom-post', //post-type
array( 
    'hierarchical'  => false, 
    'label'         => __( 'My Custom Tags','taxonomy general name'), 
    'singular_name' => __( 'Tag', 'taxonomy general name' ), 
    'rewrite'       => true, 
    'query_var'     => true 
));
Output here:

custom tags for custom post type

Leave a Comments