Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

产品

// Register Custom Post Type
function algproduct() {

	$labels = array(
		'name'                  => _x( '产品', 'Post Type General Name', 'text_domain' ),
		'singular_name'         => _x( '产品', 'Post Type Singular Name', 'text_domain' ),
		'menu_name'             => __( '产品', 'text_domain' ),
		'name_admin_bar'        => __( '产品', 'text_domain' ),
		'archives'              => __( '归档', 'text_domain' ),
		'attributes'            => __( '归档', 'text_domain' ),
		'parent_item_colon'     => __( '父类', 'text_domain' ),
		'all_items'             => __( '所有', 'text_domain' ),
		'add_new_item'          => __( '添加新的', 'text_domain' ),
		'add_new'               => __( '添加新的', 'text_domain' ),
		'new_item'              => __( '新的', 'text_domain' ),
		'edit_item'             => __( '编辑', 'text_domain' ),
		'update_item'           => __( '更新', 'text_domain' ),
		'view_item'             => __( '查看', 'text_domain' ),
		'view_items'            => __( '查看', 'text_domain' ),
		'search_items'          => __( '查找', 'text_domain' ),
		'not_found'             => __( '找不到', 'text_domain' ),
		'not_found_in_trash'    => __( '垃圾桶里找不到', 'text_domain' ),
		'featured_image'        => __( '主题图片', 'text_domain' ),
		'set_featured_image'    => __( '设置主题图片', 'text_domain' ),
		'remove_featured_image' => __( '删除主题图片', 'text_domain' ),
		'use_featured_image'    => __( '用作主题图片', 'text_domain' ),
		'insert_into_item'      => __( '插入到产品', 'text_domain' ),
		'uploaded_to_this_item' => __( '上传到这个产品', 'text_domain' ),
		'items_list'            => __( '列表', 'text_domain' ),
		'items_list_navigation' => __( '列表导航', 'text_domain' ),
		'filter_items_list'     => __( '过滤列表', 'text_domain' ),
	);
	$args = array(
		'label'                 => __( '产品', 'text_domain' ),
		'description'           => __( '各种可以购买的课程', 'text_domain' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'comments', 'revisions', 'custom-fields', 'post-formats', ),
		'taxonomies'            => array( 'category', 'post_tag' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-lightbulb',
		'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( 'algprodcut', $args );

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