Forums

[resolved] Forcing meta box to the top, before post edit (2 posts)

  1. hever
    Member
    Posted 3 weeks ago #

    Hi,
    I'm going to place a meta box in the post edit backend on the top and also before the standard post edit field.

    Perhaps the approach described in "Forcing your widget to the top" could be used to change the order of meta boxes.

    But I'm not just going to place my meta box on top of the meta boxes, I'm going to place my meta box before the standard post edit field.

    Any ideas?

    Thank you in advance!

  2. hever
    Member
    Posted 3 weeks ago #

    It seems not possible with the Wordpress API, I used jQuery:

    jQuery(document).ready(
            function()
            {
                // place meta box before standard post edit field
                if( document.getElementById('postdiv') )
                {
                    jQuery('#MyMetaBox').insertBefore('#postdiv');
                }
                else if( document.getElementById('postdivrich') )
                {
                    jQuery('#MyMetaBox').insertBefore('#postdivrich');
                }
            }
        );

Reply

You must log in to post.

About this Topic