我在functions.php中有下面的代码来支持post格式和自定义的post类型的“照片”。但我希望文章格式只适用于“照片”帖子类型,而不适用于内置的“帖子”类型。
add_theme_support( 'post-formats', array( 'image', 'chat', 'video', 'gallery' ) );
//custom post type
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'photos',
array(
'labels' => array(
'name' => __( 'Photos' ),
'singular_name' => __( 'Photo' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'photo'),
'menu_position' => 5,
'taxonomies' => array('genre'),
'supports' => array('title', 'editor', 'thumbnail', 'post-formats'),
)
);
}非常感谢您的时间和帮助。
发布于 2013-01-22 18:37:40
试试remove_post_type_support:
remove_post_type_support( 'post', 'post-formats' );https://wordpress.stackexchange.com/questions/82654
复制相似问题