Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Portfolio Post type

Portfolio post types for radixdev

// Register Custom Post Type
function portfolio() {

	$labels = array(
		'name'                => _x( 'Portfolios', 'Post Type General Name', 'radixdev' ),
		'singular_name'       => _x( 'Portfolio', 'Post Type Singular Name', 'radixdev' ),
		'menu_name'           => __( 'Portfolio Post', 'radixdev' ),
		'parent_item_colon'   => __( 'Portfolio Parent Item:', 'radixdev' ),
		'all_items'           => __( 'All Portfolio Items', 'radixdev' ),
		'view_item'           => __( 'View Portfolio Item', 'radixdev' ),
		'add_new_item'        => __( 'Add New Item', 'radixdev' ),
		'add_new'             => __( 'Add New', 'radixdev' ),
		'edit_item'           => __( 'Edit Portfolio Item', 'radixdev' ),
		'update_item'         => __( 'Update Portfolio Item', 'radixdev' ),
		'search_items'        => __( 'Search Portfolio Item', 'radixdev' ),
		'not_found'           => __( 'Not found Portfolio item', 'radixdev' ),
		'not_found_in_trash'  => __( 'Not found Portfolio Item in Trash', 'radixdev' ),
	);
	$rewrite = array(
		'slug'                => 'portfolio',
		'with_front'          => true,
		'pages'               => true,
		'feeds'               => true,
	);
	$capabilities = array(
		'edit_post'           => 'edit_post',
		'delete_post'         => 'delete_post',
		'edit_posts'          => 'edit_posts',
		'edit_others_posts'   => 'edit_others_posts',
		'publish_posts'       => 'publish_posts',
		'read_private_posts'  => 'read_private_posts',
	);
	$args = array(
		'label'               => __( 'portfolio', 'radixdev' ),
		'description'         => __( 'This is a Description for Portfolio Type Post', 'radixdev' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),
		'taxonomies'          => array( 'category', 'tag' ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'menu_position'       => 10,
		'menu_icon'           => 'http://.../icon.png',
		'show_in_admin_bar'   => true,
		'show_in_nav_menus'   => true,
		'can_export'          => true,
		'has_archive'         => true,
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'query_var'           => 'portfolio',
		'rewrite'             => $rewrite,
		'capabilities'        => $capabilities,
	);
	register_post_type( 'portfolio', $args );

}

// Hook into the 'init' action
add_action( 'init', 'portfolio', 0 );