fukr
fukr

Reputation: 3

Is there any way to change default post format in wordpress

For some reason I need to change the default post format instead of standard format. I know we can change this via

Dashboard -> Settings -> Writing

But is there any code snippet that can be put into function.php to achieve this?

Upvotes: 0

Views: 727

Answers (1)

diggy
diggy

Reputation: 6828

According to this answer you can use the option_default_post_format filter, e.g.:

function so16854774_default_post_format( $format )
{
    global $post_type;
    return ( $post_type == 'post' ? 'aside' : $format );
}
add_filter( 'option_default_post_format', 'so16854774_default_post_format', 10, 1 );

Upvotes: 1

Related Questions