0

I want a writing panel for a custom field called 'Sub-title' and would like it to appear in its logical place in the Page editor (that is, between the title and the Page content). Is that possible?

I would like to avoid having to create a custom post type, since a Page + custom fields is all I really need.

2

I am wondering why my first answer was down-voted. :)

I think the only way to do is to add a meta box below the post content field and use javascript to move it above.

This is the way it is done with the slug field in the WordPress core (the slug field is were you edit the page or post url). Disable javascript in your browser and you will see the slug field at the bottom of the page. If WordPress does it with javascript, I think the best way to do it is javascript too. As, I can't see any hook between the title and content fields which will allow it to be done without using javascript.

  • Thanks, sorich87. My JavaScript skills are basic, but I'll go dig around to see how they do it with the slug. – avesse Sep 6 '10 at 12:45
1

I'd like to also suggest the use of WPAlchemy Meta Box for creating your meta boxes ...

Then do something like:

$custom_metabox = new WPAlchemy_MetaBox(array
(
    'id' => '_custom_meta',
    'title' => 'My Custom Meta',
    'template' => TEMPLATEPATH . '/custom/meta.php',
    'lock' => 'after_post_title', 
));
0

You can add it below the content area and use javascript code to move it above it.

  • An example of how to implement your solution might have helped earlier ... – EAMann Oct 1 '10 at 18:56
  • Yes, I learnt it the hard way. :D – sorich87 Oct 1 '10 at 19:10
0

You could have a look at the excellent qTranslate. That should provide you with an example of everything you need since it adds a.o. multiple Title boxes.

0

To the best of my knowledge the priority of a meta box is limited to: Low, Default and High. Which is unlike admin menus that let you specify a value and put it anywhere. I'd try "High."

You can change the order of all your meta boxes by dragging and dropping so where ever High puts the subtitle you can drag it to be beneath the Title. The only disadvantage is that you'd have to do it for every user. There are plugins like Adminize that let you specify the order of meta boxes for all user accounts which would overcome this problem.

Create Subtitle Meta box: www.spencerfinnell.com/2010/07/05/wordpress-custom-write-panels/

Adminize Plugin: wordpress.org/extend/plugins/adminimize/

*I don't have a high enough rank to post links so you'll have to copy and paste

  • Drag and drop only works up to below the main content box. You cannot drag anything above it. – avesse Sep 6 '10 at 12:46

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.