Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function pages_taxonomy() {
- register_taxonomy(
- 'service_cat', //1. The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces). example: portfolio_cat
- 'services-items', //2. post type name , custom post id (register_post_type id): example: news_sites
- array(
- 'hierarchical' => true,
- 'label' => 'Service Category', //3. Display name
- 'query_var' => true,
- 'capabilities' => array(
- 'manage__terms' => 'edit_posts',
- 'edit_terms' => 'manage_categories',
- 'delete_terms' => 'manage_categories',
- 'assign_terms' => 'edit_posts'
- ),
- 'rewrite' => array(
- 'slug' => 'service-category', // 4. This controls the base slug that will display before each term
- 'with_front' => false // Don't display the category base before
- )
- )
- );
- }
- add_action( 'init', 'pages_taxonomy');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment