WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following code in functions.php to give me post format support and a custom post type 'photos'. But I would like the post formats to only apply to the 'photos' post type and not to the built-in 'posts' post type.

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',
            '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'),

Many thanks for your time and help.

share|improve this question
up vote 2 down vote accepted

Try remove_post_type_support:

remove_post_type_support( 'post', 'post-formats' );
share|improve this answer
Doesn't seem to work... the format box is still there is the Posts' "Add New Post" window. – Gab Jan 22 '13 at 18:53
Did you hook into init? – diggy Jan 22 '13 at 18:57
Sorry I didn't know I had to put it inside the function create_post_type. Thanks a lot! – Gab Jan 23 '13 at 2:20

try this:

function add_post_type_support_stuff( $post ){

    $screen = get_current_screen();
    $post_type = $screen->post_type;

    if( $post_type == 'photos' ) {
        //add this if you did not add support for the post type when you called register_post_type()
        add_post_type_support( 'page', 'post-formats' );
        //add the post formats
        add_theme_support('post-formats',array( 'image', 'chat', 'video', 'gallery' ));

share|improve this answer
+1 for $post_type = $screen->post_type; – mems Apr 30 '14 at 14:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.