I have a post type named services
with the following permalink DOMAIN/services/investing/
(Single Page Permalink).
I want the permalink to be changed like DOMAIN/investing/
. I don't want the POST_TYPE in my permalink.
I updated the permalink settings in WP Dashboad. But it only changed to blog posts, not to the custom post types.
How can I customize the permalink of custom post types?
The POST_TYPE is created using register_post_type
as below.
function cp_services() {
register_post_type('Services', array(
'labels' => array(
'name' => 'Services',
'singular_name' => 'service',
'add_new_item' => 'Add New Service',
'edit_item' => 'Edit Service',
),
'description' => 'Services',
'public' => true,
'has_archive' => true,
'menu_position' => 20,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'supports' => array('title','editor','thumbnail')
));
}
add_action('init', 'cp_services');
register_post_type
?register_post_type