Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Please could someone give me an idiots guide to adding more than one TinyMCE editor to a page editor page please. I am creating my own wordpress theme and the multiple editors are an essential part of the website.

I would like to know what code I need to add and where I add it for the editors to appear in the Editor side and the code needed to output the code to the live website.

I have searched online for the answer but can not understand the ones that I have found. I have only just started learning PHP.

Any help will be gratefully appreciated!

Andi

share|improve this question
    
possible duplicate of two tinyMCE editors in the same page –  dcc Jul 3 at 4:17
add comment

2 Answers

You'll need to use add_meta_box() to setup the field and wp_editor() to make a new instance of TinyMCE.

share|improve this answer
1  
Isn't there a problem with use tinyMCE editors in metaboxes? I believe its to do with the fact that the editors shouldn't be place in something that is moveable? (But I can't find the link currently...) –  Stephen Harris Sep 27 '12 at 10:25
1  
You're right. From wp_editor(): "Once instantiated, the WYSIWYG editor cannot be moved around in the DOM. What this means in practical terms, is that you cannot put it in meta-boxes that can be dragged and placed elsewhere on the page." I'm not sure whether you can make metaboxes unmoveable. –  mrwweb Sep 27 '12 at 14:31
add comment

I've got a class on Gist that will create a full secondary TinyMCE post editor which will look and function exactly like the original editor complete with toolbar, support for shortcodes, etc.. Just drop it into your theme and assign the post_type which should display the editor. You can then call the content saved to the secondary editor with the function get_the_subcontent() similarly as you would for the_content()

https://gist.github.com/dcondrey/ae987ec166fde5e35be3

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.