0

I have added post formats support to my theme. The post formats box appears on the bottom of the sidebar in the New/Edit post page. It appears below the Categories, Tags and Featured Image. Is it possible to change its position in the sidebar and for example show it before the categories?

I understand we can drag and drop the boxes, but I want to set the default position.

Thanks.

1 Answer 1

0

What you can do is remove the post formats meta box and adding again in another position.

If you put this in functions.php:

// remove post format meta box
function remove_post_format_box() {
    remove_meta_box( 'formatdiv' , 'post' , 'side' ); 
}
add_action( 'admin_menu' , 'remove_post_format_box' );


// Add post format meta box to a new position
function add_post_format_box() {
    add_meta_box( 
        'formatdiv', 
        _x( 'Format', 'post format' ),    // for translation
        'post_format_meta_box',    // use the same wordpress already defined function
        'post', 
        'side',   // context
        'high'    // priority in that context
    );
}
add_action( 'add_meta_boxes', 'add_post_format_box' );

With this you put the post format box in the first position of the sidebar. Using this method it's not possible to define the exact position it will appear, you can only define its priority in a certain part of the page, unless its moved by the user.

Another option is to use some jQuery or javascript to move the post-format box to another location.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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