Skip to content

Instantly share code, notes, and snippets.

@zogot
Last active April 14, 2020 06:05
Show Gist options
  • Save zogot/5477119 to your computer and use it in GitHub Desktop.
Save zogot/5477119 to your computer and use it in GitHub Desktop.
WordPress Meta Boxes above the Editor. Including a sortable content area.
<?php
/**
* Prints all metaboxes with the above context
* above the editor
*/
function themeplugin_prefix_meta_box_above() {
global $post;
echo '<div id="postbox-container-3" class="postbox-container">';
do_meta_boxes( get_current_screen(), 'above', $post );
echo '</div>';
}
add_action( 'edit_form_after_title', 'themeplugin_prefix_meta_box_above' );
// In the add_meta_box call, in the context parameter,
// which normally allows 'normal', 'advanced' or 'side' instead use 'above'
#postbox-container-3 {
float:none;
}
#post-body #above-sortables {
min-height:50px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment