I’m creating a meta box for my custom post type. There are multiple fields where I would like to use wysiwyg editor rather than <textarea>
. Is is possible to add multiple editors to a meta box?
I would really appreciate your help!
Many thanks.
Dasha
Here is full code example:
P.S. MUST-Recommendation from my experience:
Forget adding custom codes, use Advanced Custom Fields, it’s excellent and simplify your life.
http://codex.wordpress.org/Function_Reference/wp_editor was by far the easiest method I found, built into WordPress since 3.3 (so upgrade 😉 )
But you need to replace presentation with nl2br() function as textarea in custom templates have the toogle JS issue, that removes all your
<P>
and<br/>
tags and therefore all line breaks.You can use the wordpress default text editor in the metabox using
Try the custom field template plugin http://wordpress.org/extend/plugins/custom-field-template/
This did the trick for me:
http://www.farinspace.com/multiple-wordpress-wysiwyg-visual-editors/
It’s basically creating your textarea with an id, then calling from js:
Hope it helps!
First install TinyMCE Advanced plugin.
Second add “theEditor” class to your textarea like this
Thats it
😉
Nabeel