Creating custom taxonomy for WordPress to specific post type

  • 0

Add below code inside function.php

add_action( ‘init’, ‘taxonomy_create’);

function taxonomy_create() {
register_taxonomy(
‘imagecategories’, // category name
‘imageslider’,  // post type slug name
array(
‘hierarchical’ => true,
‘label’ => ‘Image categories’  // label for that category
)
);
}

Add below code inside function.php add_action( ‘init’, ‘taxonomy_create’); function taxonomy_create() { register_taxonomy( ‘imagecategories’, // category name ‘imageslider’,  // post type slug name array( ‘hierarchical’ => true, ‘label’ => ‘Image categories’  // label for that category ) ); }

Add below code inside function.php add_action( ‘init’, ‘taxonomy_create’); function taxonomy_create() { register_taxonomy( ‘imagecategories’, // category name ‘imageslider’,  // post type slug name array( ‘hierarchical’ => true, ‘label’ => ‘Image categories’  // label for that category ) ); }

Leave a Reply

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