I want to add post formats for each post type. For example, I have a post type ‘Gallery’. I want to add ‘images’, ‘galleries’ and ‘videos’ in this post. In normal posts I want to use another list of post formats.
I try:
function postf()
{
global $post_ID;
$postType = get_post_type( $post_ID );
if( $_GET['post_type'] || $postType == 'gallery-custompost' )
{
add_theme_support( 'post-formats', array( 'image', 'gallery', 'video' ) );
add_post_type_support( 'gallery-custompost', 'post-formats' );
}
}
add_action('init', 'postf');
When I add a new post, it works, but when I try to edit it, the post format does not appear.
Does anyone have any idea how I must do it?