Title: Using TinyMCE inside tmplates
Last modified: August 19, 2016

---

# Using TinyMCE inside tmplates

 *  Resolved [chrisdornan](https://wordpress.org/support/users/chrisdornan/)
 * (@chrisdornan)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/using-tinymce-inside-tmplates/)
 * I am embedding an application within wordpress and have a need to edit formatted
   text–i.e., I need an invocation of TinyMCE. I could download TinyMCE and install
   it and work out where to get and how to add all the plugins that WordPress is
   using, but WordPress has them all sitting there, ready to go, if only I knew 
   how to invoke them.
 * Is there a discussion somewhere of how to invoke TinyMCE within a template, ideally
   with the exact-same configuration as used to edit posts, including (say) the 
   TinyMCE advanced pugin?
 * I hope thids makes sense. I have been searching high and low to get mre information
   on this, and trying things out without success. Thanks in advance for any help
   or insights.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/using-tinymce-inside-tmplates/#post-989218)
 * Hi chrisdornan,
 * You want to do something like this (assuming that you are talking about admin
   pages):
 * Put the following, or similar, in your plugin somewhere.
 *     ```
       function the_editor_enqueu() { // add libraries for editor
               wp_enqueue_script('post');
               wp_enqueue_script('media-upload');
               wp_enqueue_script('word-count');
               wp_enqueue_script('schedule');
               wp_enqueue_script('editor');
               add_thickbox();
               wp_admin_css('thickbox');
           }
   
           function enqueue_editor_head() {
               if (function_exists('wp_tiny_mce')) wp_tiny_mce();
           }
       ```
   
 * Then invoke them like this:
 *     ```
       add_action('admin_head',array(&$this, 'enqueue_editor_head'));
       add_action('admin_menu',array(&$this, 'the_editor_enqueu'));
       ```
   
 * You probably want to add a switch so that you are only loading this stuff on 
   the pages you need it on.
 * Then, invoke the editor where you want it with : `the_editor($whateveryouwanttoedit);`
 * The above works for me. I’m using it for several different admin pages. Maybe
   someone else has a better suggestion, though.
 *  Thread Starter [chrisdornan](https://wordpress.org/support/users/chrisdornan/)
 * (@chrisdornan)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/using-tinymce-inside-tmplates/#post-989327)
 * That has certainly got me going–thanks!
 *  Thread Starter [chrisdornan](https://wordpress.org/support/users/chrisdornan/)
 * (@chrisdornan)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/using-tinymce-inside-tmplates/#post-989534)
 * See the follow up thread, [Which Admin Page amd I on?](http://wordpress.org/support/topic/246364)
   for the full reolution, where, , as advised by apljdi, I find out how to ‘add
   a switch so that you are only loading this stuff on the pages you need it on’.
 *  [zbq](https://wordpress.org/support/users/zbq/)
 * (@zbq)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/using-tinymce-inside-tmplates/#post-989611)
 * Hi apljdi,
    It seems not work in my plugin, when I want to switch the editor 
   from HTML to VISUAL, there is an error. And I’m sure I have invoked the functions
   as:
 *     ```
       add_action('admin_head',array(&$this, 'enqueue_editor_head'));
       add_action('admin_menu',array(&$this, 'the_editor_enqueu'));
       ```
   
 * And my another question is how to invoke the WP editor in a template (or public
   pages not admin page)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Using TinyMCE inside tmplates’ is closed to new replies.

 * 4 replies
 * 3 participants
 * Last reply from: [zbq](https://wordpress.org/support/users/zbq/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/using-tinymce-inside-tmplates/#post-989611)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
