您需要確保您的自定義帖子類型允許使用特色圖片。下面是所允許的自定義後類型的縮略圖的示例:
<?php
function your_custom_post_types() {
// Portfolio
$labels_portfolio = array(
'add_new' => __('Add New', 'portfolio'),
'add_new_item' => __('Add Portfolio Item'),
'edit_item' => __('Edit Portfolio Post'),
'menu_name' => __('Portfolio'),
'name' => __('Portfolio', 'post type general name'),
'new_item' => __('New Portfolio Item'),
'parent_item_colon' => '',
'singular_name' => __('Portfolio Post', 'post type singular name'),
'view_item' => __('View Portfolio Item'),
);
$args_portfolio = array(
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'labels' => $labels_portfolio,
'menu_position' => 4,
'public' => true,
'publicly_queryable' => true,
'query_var' => true,
'rewrite' => array('slug' => 'portfolio', 'with_front' => true),
'show_in_menu' => true,
'show_ui' => true,
'supports' => array('comments', 'editor', 'excerpt', 'thumbnail', 'title'),
);
register_post_type('portfolio', $args_portfolio);
}
?>
允許縮略圖中的線,這是一個:
'supports' => array('comments', 'editor', 'excerpt', 'thumbnail', 'title'