Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Author Profile

Custom post type for creating an author profile

// Register Custom Post Type
function register_author_profile() {

	$labels = array(
		'name'                  => _x( 'Author Profiles', 'Post Type General Name', 'author-profiles' ),
		'singular_name'         => _x( 'Author Profile', 'Post Type Singular Name', 'author-profiles' ),
		'menu_name'             => __( 'Authors', 'author-profiles' ),
		'name_admin_bar'        => __( 'Author', 'author-profiles' ),
		'archives'              => __( 'Author Profile Archives', 'author-profiles' ),
		'attributes'            => __( 'Author Profile Attributes', 'author-profiles' ),
		'parent_item_colon'     => __( 'Parent Author:', 'author-profiles' ),
		'all_items'             => __( 'All Authors', 'author-profiles' ),
		'add_new_item'          => __( 'Add New Author', 'author-profiles' ),
		'add_new'               => __( 'Add New Author', 'author-profiles' ),
		'new_item'              => __( 'New Author', 'author-profiles' ),
		'edit_item'             => __( 'Edit Author', 'author-profiles' ),
		'update_item'           => __( 'Update Author', 'author-profiles' ),
		'view_item'             => __( 'View Author', 'author-profiles' ),
		'view_items'            => __( 'View Authors', 'author-profiles' ),
		'search_items'          => __( 'Search Author', 'author-profiles' ),
		'not_found'             => __( 'Author not found', 'author-profiles' ),
		'not_found_in_trash'    => __( 'Author not found in Trash', 'author-profiles' ),
		'featured_image'        => __( 'Profile Image', 'author-profiles' ),
		'set_featured_image'    => __( 'Set profile image', 'author-profiles' ),
		'remove_featured_image' => __( 'Remove profile image', 'author-profiles' ),
		'use_featured_image'    => __( 'Use as profile image', 'author-profiles' ),
		'insert_into_item'      => __( 'Insert into author', 'author-profiles' ),
		'uploaded_to_this_item' => __( 'Uploaded to this author', 'author-profiles' ),
		'items_list'            => __( 'Authors list', 'author-profiles' ),
		'items_list_navigation' => __( 'Authors list navigation', 'author-profiles' ),
		'filter_items_list'     => __( 'Filter authors list', 'author-profiles' ),
	);
	$args = array(
		'label'                 => __( 'Author Profile', 'author-profiles' ),
		'description'           => __( 'Profiles for authors', 'author-profiles' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'custom-fields' ),
		'taxonomies'            => array( 'category', 'post_tag' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-id-alt',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => true,
		'exclude_from_search'   => true,
		'publicly_queryable'    => true,
		'capability_type'       => 'page',
	);
	register_post_type( 'author_profile', $args );

}
add_action( 'init', 'register_author_profile', 0 );