CPT services
services for portfolio
// Register Custom Post Type
function custom_post_types() {
$labels = array(
'name' => _x( 'Services', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Service', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Services', 'text_domain' ),
'name_admin_bar' => __( 'Services', 'text_domain' ),
'parent_item_colon' => __( 'Parent service:', 'text_domain' ),
'all_items' => __( 'All services', 'text_domain' ),
'add_new_item' => __( 'Add New service', 'text_domain' ),
'add_new' => __( 'Add New', 'text_domain' ),
'new_item' => __( 'New service', 'text_domain' ),
'edit_item' => __( 'Edit service', 'text_domain' ),
'update_item' => __( 'Update service', 'text_domain' ),
'view_item' => __( 'View service', 'text_domain' ),
'search_items' => __( 'Search service', 'text_domain' ),
'not_found' => __( 'Not found', 'text_domain' ),
'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),
'items_list' => __( 'Items list', 'text_domain' ),
'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),
'filter_items_list' => __( 'Filter items list', 'text_domain' ),
);
$rewrite = array(
'slug' => 'service',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __( 'Service', 'text_domain' ),
'description' => __( 'For the services portfolio', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'revisions', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-admin-generic',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'page',
);
register_post_type( 'post_type_services', $args );
}
add_action( 'init', 'custom_post_types', 0 );