I want to add a second input identical in design/functionality to the Title text input, directly beneath it.

I can use

add_meta_box('catchy_title', 'Short Title', array('catchyTitle', 'metaBoxShow'), 'post', 'normal', 'high');

And the content

<div id="titlewrap">
     <label for="catchy_title" class="">Enter shorter title here</label>
     <input type="text" autocomplete="off" id="catchy_title" value="'.$meta.'" size="20" name="catchy_title">

However this puts a grey metabox around it. Should I even be using a metabox? I basically want to duplicate this field:


but I end up with


and it's under the rich text editor too.

Here is the full code if it helps: http://pastebin.com/NiFHAUmq


Use the action edit_form_after_title.


add_action( 'edit_form_after_title', function() {
    echo 'Enter some text: <input type=text>';

enter image description here

See this answer for another example.

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.