WordPress post category add

Posted: December 22, 2014 in WordPress

if (!function_exists('new_category')) {
function new_category() {

$url_rewrite = 'category-slug';

register_taxonomy('new_category', 'post_type',

array(
'hierarchical' => true,
'labels' => array(
'name' => 'Counseling',
'singular_name' => 'Counseling',
'search_items' => 'Search in Counseling',
'popular_items' => 'Popular Counseling',
'all_items' => 'All Counseling',
'parent_item' => 'Parent Counseling',
'parent_item_colon' => 'Parent Counseling:',
'edit_item' => 'Edit Counseling',
'update_item' => 'Update Counseling',
'add_new_item' => 'Add New Counseling',
'new_item_name' => 'New Counseling Name'
),
'show_ui' => true,
'query_var' => true,
'rewrite' => array('slug' => $url_rewrite)
)
);
}
add_action('init', 'wpl_staff_category');
}
Advertisements

Comments are closed.