180 responses to “How to Use Multiple WordPress WYSIWYG Visual Editors”

  1. Armand

    I found a solution to fix waky ul’s and paragraphs. It works.

    I added a javascript file I borrowed from TinyMCE Advanced…

    I’ve posted it here…. paste it right after the javascript that Dimas posted above. That’s what I did.

    Here’s the linke: https://gist.github.com/1190684

  2. Cale

    Thanks for the code. I am having problems when adding additional meta box groups. I have tried a few different javascript resources from these comments but can’t get any to work.

    When I add a new meta group I can’t edit the TinyMCE until I save the page and go back into it. Have anyone got the same problem/solution. Thanks.

  3. Joren Rapini

    I’ve used this several times on many websites and it’s worked awesomely, but I just grabbed your latest version (which now places the WPAlchemy folder inside wp-content and inclue a setup.php from the metaboxes folder, the old versions I used relate to this post more accurately with the WPalchemy folder inside the theme) but when I tried using the latest version, any WYSIWYG textareas would replace their data with the HTML but in the “Visual” view, so that when the page would update it would replace all of the syntax with & code. I switched everything over to old files that I had laying around from previous websites and it worked perfectly.

  4. Joren Rapini

    Also I just noticed another issue, it doesn’t accurately portray WordPress’ image caption shortcode.

  5. Joren Rapini

    Nevermind, I figured that last bit out by surrounding it with apply_filters. Sorry to waste your time on that haha :)

  6. kathy

    and i’m back to having the issue w/ the textareas. using wp_richedit_pre the html markup gets turned into ampersands, and not using it loses the linebreaks.

  7. kathy

    ok, so i just rolled back to 1.4.9 and this issue of html tags being converted into special characters is resolved, so it must be something that has been added to the class between 1.4.9 and the current 1.4.15

    i think line 1675 might be at fault:

    return htmlentities($value, ENT_QUOTES, ‘UTF-8′);

  8. Jon

    use this:
    esc_html( wp_richedit_pre ( $mb->get_the_value() ) )

  9. Dean

    using both Armand’s code and Jon’s, all the problems i was having where fixed. namely, the outputted escaped html and the non outputted linebreaks.

    thanks !

  10. Armand

    Ok, everything is working for me except one small but annoying problem. If my metbox is shown as “CLOSED” the when I open it, tinymce area is shortened and the formatting is off. Now if I click in the area it springs into place to look normal.

    Like I said, everything works, it’s just this small annoying problem on a closed metabox and then opening it.

    Anyone else experience this problem?

  11. Johan Dahl

    I´m using TinyMCE and checking the option to not remove p and br tags when saving. That works for me.

    I´m having another issue though, I can´t style the tinymce area. It has a grey background for some reason and it should be white. I am importing my own editor-style.css from the TinyMCE Advanced plugin but it doesnt apply. I also tried doing it through functions.php but that didnt work either. Strange thing is that if I check the css in firefox then it firebug say´s it´s using my editor-style.css. But the actual styles are not from that file, thats easy to see. So, where do the styles come from and how do I overwrite them?

  12. Mamouneyya

    Any chance you can share your code for adding the media buttons to the TinyMCE fields? Are they work with repeatable fields?

  13. Johan Dahl

    I´m having trouble with pictures/media beeing inserted into the default editor ending up in my wysisyg-editor created by wpalchey instead of where they should. I saw someone else had the same trouble back in the comments, but trying out the code they suggested disables my wysiwyg-editor completly.

    This is how I set up my editor in functions.php :

    What can I do to fix this?

  14. Johan Dahl

    I just noticed I can avoid the problem by setting the default editor to WYSISYG-mode instead of html-mode. That will insert the media into the default editor. That aint optimal but it´s totally ok anyway!

  15. Mamouneyya

    Anyone knows how to add media buttons for a TinyMCE custom field?

  16. Mamouneyya

    @Dimas Please, could you help? I need to add media rows for repeatable WYSIWYG fields..

  17. Jonathan Liuti

    +1 to the above comment! I need this too!

  18. Denoizzed

    Upload buttons instructions would be nice :)


  19. Antonio


    is this really needed??

    // lets use the WPAlchemy helper
    include_once TEMPLATEPATH . '/WPAlchemy/MetaBox.php';

    // custom constant (opposite of TEMPLATEPATH)
    define('_TEMPLATEURL',WP_CONTENT_URL . '/themes/' . basename(TEMPLATEPATH));

    // custom css for our meta boxes
    if (is_admin()) wp_enqueue_style('custom_meta_css',_TEMPLATEURL . '/custom/meta.css');

    I copied the css parte in the already present /metaboxes/meta.css and removed the include metabox.php and works fine.



  20. Elle

    How to show the editor if the textarea is added via Ajax? Currently MCE doesn’t display until the post is saved.

  21. Thisandthat


    Have used this and all is well except that the outputted text in the site template is stripped of HTMl and so is negating the whole thing.

    I’m guessing that I’m missing something pretty simple but just trying to output the content of the meta box in the normal way.

    The content is there but stripped of HTML. Any ideas….?


  22. Thisandthat

    Ok, ignore my last message – just went through the comments. Poor form on my part to have missed the work arounds on this… :-)

    Awesome work on WPAlchemy though Dimas, fantastic. Have a great weekend.

  23. Bercana

    The new wp_editor() function in WordPress 3.3 is going to make this much easier.

  24. Bercana

    p.s. If you need more than just WYSIWYG editors (i.e. radios and such) then the More Fields plugin is a dream. Very hassle-free compared to rolling your own or using WPAlchemy.

  25. antonio


    I made this working but when in the normal content editor of the post, I cchange to “html” mode all the breaklines are removed and i cannot see the paragraphs, etc…

    do you have the same problme??
    I used the code for armand also but its not working


Leave a Reply