【发布时间】:2015-06-03 13:06:04
【问题描述】:
我在 wordpress 中创建自定义帖子类型。但我也想显示帖子格式报价和图像。我在哪里选择帖子格式报价或图像。这是我的自定义帖子类型代码!
function Quotes_sky() {
$labels = array(
'name' => _x( 'Quotes', 'post type general name', 'your-plugin-textdomain' ),
'singular_name' => _x( 'Quote', 'post type singular name', 'your-plugin-textdomain' ),
'menu_name' => _x( 'Quotes', 'admin menu', 'your-plugin-textdomain' ),
'name_admin_bar' => _x( 'Quote', 'add new on admin bar', 'your-plugin-textdomain' ),
'add_new' => _x( 'Add New', 'Quote', 'your-plugin-textdomain' ),
'add_new_item' => __( 'Add New Quote', 'your-plugin-textdomain' ),
'new_item' => __( 'New Quote', 'your-plugin-textdomain' ),
'edit_item' => __( 'Edit Quote', 'your-plugin-textdomain' ),
'view_item' => __( 'View Quote', 'your-plugin-textdomain' ),
'all_items' => __( 'All Quotes', 'your-plugin-textdomain' ),
'search_items' => __( 'Search Quotes', 'your-plugin-textdomain' ),
'parent_item_colon' => __( 'Parent Quotes:', 'your-plugin-textdomain' ),
'not_found' => __( 'No Quotes found.', 'your-plugin-textdomain' ),
'not_found_in_trash' => __( 'No Quotes found in Trash.', 'your-plugin-textdomain' )
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'Quotes' ),
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => 5,
'menu_icon' => 'dashicons-editor-quote',
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ) ,
'taxonomies' => array ( 'category', 'post_tag' )
);
register_post_type( 'Quotes Sky', $args );
}
这是屏幕短。希望这有助于理解我的问题
【问题讨论】:
标签: php wordpress custom-post-type