Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've enabled custom posts types

add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote', 'image' ) );

The default post type is set on Standard, and it works for all but the Standard type, when I have a standard post the get_post_format() return empty. did I miss something in enabling them?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Because "Standard" is not a format itself - it simply implies that the post has no formats.

...which is somewhat deceptive, given it's listed in the Format meta-box as a format to choose

I think "standard" quite clearly implies what it means. If you're creating a site in which a post is never "standard", then fallback to a default:

if ( ! $format = get_post_format() )
    $format = 'gallery';

Alternatively, hook onto wp_insert_post and enforce a format if one has not already been set.

function set_default_format( $post_id )
{
    if ( ! get_post_format( $post_id ) )
        set_post_format( $post_id, 'gallery' );
}
share|improve this answer
1  
...which is somewhat deceptive, given it's listed in the Format meta-box as a format to choose. This ties into why it's it's not possible to remove the Standard "format" (bar the gymnastics in the accepted answer) even if you never intend to use it. –  Su' Jul 11 '12 at 10:03
    
Check out my revision for some further comments on the matter. –  TheDeadMedic Jul 11 '12 at 10:25
add comment

Your Answer

 
discard

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.