TinyMCE in a div / textarea on frontend?

What you’re looking for is two things:

  1. The wp_tiny_mce function that loads all the needed JS etc
  2. The code below:

This to setup the JS etc:

// Setup the TinyMCE stuff and target it at our desired textarea
wp_tiny_mce( true, array( "editor_selector" => 'tinymce_class' ) );

And this HTML where you need the editor box:

<div class="editor_container">
    <textarea class="large-text tinymce_class" rows="5" id="tinymce_1" name="name">
        <?php echo esc_html($value) ?>
    </textarea>
</div>

Leave a Comment