What’s the simplest way to add a second HTML editor to the post/page admin and show the content in a template?
What I need is something like a custom field that supports html, but I don’t need the options to name the field. And I don’t need a visual editor like tinyMCE; just html will do.
What I’m thinking of is simply a small text-editor box that sits under the main visual/html editor and shows the resulting html in a template via <?php if ( function_exists('my_extra_editor_content') ) ...
with the text/html in a styleable div.
Plugins like http://wordpress.org/extend/plugins/custom-field-template/ and http://wordpress.org/extend/plugins/developers-custom-fields/ offer too much in terms of functions and choices.
I use Bill Erickson’s custom meta boxes
or plugin like Secondary HTML Content (probably the easiest solution)
I dont know if this will help but any Custom Field input will support html. I use html there all the time for headings and custom text in posts and pages.
For future travelers, the custom metaboxes are not a good idea for adding a second editor in pages. You should use
wp_editor
function inside theedit_page_form
action so the form can be displayed. (You should useedit_form_advanced
action for custom post types)Then you can use the
save_post
and get the value of the editor from$_POST
object. Here’s an example:Have you tried a textarea in a meta box? Meta boxes are more user friendly.
About your requirement, it sounds like just a textarea will do. Please be aware that even full tinyMce based editors are possible using existing WordPress libraries.
Update from 2020. This is now extremely easily achievable with the Advanced Custom Fields plugin and using its provided function call
the_field('field_ref')
to insert in the page.