CH Portfolio
Portfolio CPT
// Register Custom Post Type
function portfolio_post() {
$labels = array(
'name' => _x( 'Portfolio', 'Post Type General Name', 'hursty-wp' ),
'singular_name' => _x( 'Portfolio', 'Post Type Singular Name', 'hursty-wp' ),
'menu_name' => __( 'Porfolio', 'hursty-wp' ),
'name_admin_bar' => __( 'Portfolio', 'hursty-wp' ),
'archives' => __( 'Portfolio Archives', 'hursty-wp' ),
'parent_item_colon' => __( 'Parent Item:', 'hursty-wp' ),
'all_items' => __( 'All Portfolio Posts', 'hursty-wp' ),
'add_new_item' => __( 'Add Portfolio Posts', 'hursty-wp' ),
'add_new' => __( 'Add New', 'hursty-wp' ),
'new_item' => __( 'New Post', 'hursty-wp' ),
'edit_item' => __( 'Edit Post', 'hursty-wp' ),
'update_item' => __( 'Update Post', 'hursty-wp' ),
'view_item' => __( 'View Post', 'hursty-wp' ),
'search_items' => __( 'Search Post', 'hursty-wp' ),
'not_found' => __( 'Not found', 'hursty-wp' ),
'not_found_in_trash' => __( 'Not found in Trash', 'hursty-wp' ),
'featured_image' => __( 'Portfolio Image', 'hursty-wp' ),
'set_featured_image' => __( 'Set Portfolio Image', 'hursty-wp' ),
'remove_featured_image' => __( 'Remove Portfolio Image', 'hursty-wp' ),
'use_featured_image' => __( 'Use as Portfolio Image', 'hursty-wp' ),
'insert_into_item' => __( 'Insert into Post', 'hursty-wp' ),
'uploaded_to_this_item' => __( 'Uploaded to this post', 'hursty-wp' ),
'items_list' => __( 'Posts list', 'hursty-wp' ),
'items_list_navigation' => __( 'Posts list navigation', 'hursty-wp' ),
'filter_items_list' => __( 'Filter posts list', 'hursty-wp' ),
);
$args = array(
'label' => __( 'Portfolio', 'hursty-wp' ),
'description' => __( 'Portfolio Posts', 'hursty-wp' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-portfolio',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => 'portfolio',
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'portfolio', $args );
}
add_action( 'init', 'portfolio_post', 0 );