我剛創建了自定義帖子類型,但由於某些原因,精選圖像元框未顯示。WordPress的 - 精選圖像元框不顯示在自定義帖子類型
儘管它顯示在「帖子」帖子類型上。
我已啓用縮略圖的主題支持,並在我的自定義帖子類型代碼中添加了以下代碼。
<?php
function register_cpt_product() {
$labels = array(
'name' => _x('Products', 'product'),
'singular_name' => _x('Product', 'product'),
'add_new' => _x('Add New', 'product'),
'add_new_item' => _x('Add New Product', 'product'),
'edit_item' => _x('Edit Product', 'product'),
'new_item' => _x('New Product', 'product'),
'view_item' => _x('View Product', 'product'),
'search_items' => _x('Search Products', 'product'),
'not_found' => _x('No products found', 'product'),
'not_found_in_trash' => _x('No products found in Trash', 'product'),
'parent_item_colon' => _x('Parent Product:', 'product'),
'menu_name' => _x('Products', 'product'),
);
$args = array(
'labels' => $labels,
'hierarchical' => false,
'description' => 'Allows the user to create products',
'supports' => array('title', 'editor', 'thumbnail', 'revisions'),
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'has_archive' => true,
'query_var' => true,
'can_export' => true,
'rewrite' => true,
'capability_type' => 'post'
);
register_post_type('product', $args);
}
add_action('init', 'register_cpt_product');
?>
奇怪的是,在列出我的帖子類型的頁面上,有一列叫做縮略圖。
任何人都知道是怎麼回事?
感謝
我在我的問題中說過,我已經啓用了縮略圖的主題支持,所以不是這樣。 –
對不起,我一定錯過了。如果您在註冊帖子類型後運行'add_post_type_support('your-type','thumbnail');'它有什麼區別? – Simon
我會在幾分鐘內嘗試。我的意思是我用一些奇怪的東西更新了我的問題。謝謝 –