Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

BB Author

if ( ! function_exists('bbauthor_post_type') ) {

// Register Custom Post Type
function bbauthor_post_type() {

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

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

}