Default, locked sorting of posting fields

I can answer the last part: “I also want the excerpt-field to be above the content-field. Is all this possible?”

The only way to move anything above the content field is via JavaScript–there are no php hooks or filters up there. It’s kind of a lame workaround because you can usually see (visually) the jump as the fields reorder. But AFAIK it’s the only way to do this.

jQuery(document).ready( function($) {

    // On DOM ready move the excerpt field above the WYSIWYG field
    if( document.getElementById('postdiv') && document.getElementById('postexcerpt') ) {
        jQuery('#postexcerpt').insertBefore('#postdiv');
    } else if( document.getElementById('postdivrich') && document.getElementById('postexcerpt') ) {
        jQuery('#postexcerpt').insertBefore('#postdivrich');
    }

});

Leave a Comment