Title: CKEditor with Multiple Comment Forms &#8211; Only First Instance Is Initialized
Last modified: August 21, 2016

---

# CKEditor with Multiple Comment Forms – Only First Instance Is Initialized

 *  [own3mall](https://wordpress.org/support/users/own3mall/)
 * (@own3mall)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/ckeditor-with-multiple-comment-forms-only-first-instance-is-initialized/)
 * Hi All,
 * I am using a plugin called Pods for WordPress along with the latest version of
   CKEditor for WordPress. I have created a custom post type and created a page 
   template to display all custom posts. The template requests that each custom 
   post display a comment form. When the template for the page is loaded, only the
   first custom post comment section gets initialized as CKEditor. The rest are 
   blank textareas.
 * Here’s a screenshot:
 * [Screenshot](http://postimg.org/image/o75cedbzp/)
 * My template uses the following code:
 *     ```
       <p class="spTitle">New Deal</p>
       <p class="special">Presented By: <a href="{@company_url}" target="_blank">{@company_name}</a></p>
   
       <p><a href="{@company_url}" target="_blank"><img src="{@company_logo}" class="imgResize" /></a></p>
       <br>
   
       <?php
       $post_id = get_the_ID();
   
       $comment_array = get_approved_comments($post_id);
   
       $i = 0;
       foreach($comment_array as $comment){
           if($i == 0){
               echo "<h3>Comments</h3>";
           }
           $authorDate = date("n/d/Y h:i:s A", strtotime($comment->comment_date));
           echo "<p class=\"posted_comment_info\">Posted " .$authorDate. " by <span class=\"comment_author\">" .$comment->comment_author."</span></p>" . $comment->comment_content;
           $i++;
       }
       $args["comment_notes_after"] = "";
       $args["comment_field"] = '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) .
           '</label><textarea id="comment" class="ckeditor" name="comment" cols="45" rows="8" aria-required="true">' .
           '</textarea></p>';
       comment_form( $args, $post_id ); 
   
       ?>
       <p class="date">Offer Posted:  {@offer_date}</p>
       <hr class="special" />
       ```
   
 * As you can see, I assigned the ckeditor class to each comment textarea, but even
   that didn’t cause CKEditor to be initialized for these instances.
 * So, is it possible to initialize multiple CKEditor instances for each comment
   form that is displayed on the page, and if so, how would I go about doing it?
 * Any help is appreciated.
 * [http://wordpress.org/plugins/ckeditor-for-wordpress/](http://wordpress.org/plugins/ckeditor-for-wordpress/)

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

 *  [Scott Kingsley Clark](https://wordpress.org/support/users/sc0ttkclark/)
 * (@sc0ttkclark)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/ckeditor-with-multiple-comment-forms-only-first-instance-is-initialized/#post-4537423)
 * Each ckeditor textarea likely needs to have a unique ID, maybe even field name
   if you have multiple textareas inside the same form element.
 *  Thread Starter [own3mall](https://wordpress.org/support/users/own3mall/)
 * (@own3mall)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/ckeditor-with-multiple-comment-forms-only-first-instance-is-initialized/#post-4537556)
 * Each ckeditor instance would be in its own form. What’s strange is that if I 
   include the ckeditor javascript files manually within my theme, each instance
   is initialized but has full controls because I don’t know how to specify that
   is use the WordPress configuration.
 * So for some reason, even though each textarea is in its own field and has a class
   of ckeditor, only the first instance is initialized. Any idea why or where I 
   can change this behavior?
 *  [mitcheljh](https://wordpress.org/support/users/mitcheljh/)
 * (@mitcheljh)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/ckeditor-with-multiple-comment-forms-only-first-instance-is-initialized/#post-4537585)
 * I seem to be having the same problem.
    I’m trying to have two separate instances
   of ckeditor. Both are in different forms, and they have different ids and names.
   One of them is for comments, and the other for bbpress (I have them in separate
   tabs).
 * Only one of the instances is being displayed.
 *  [mitcheljh](https://wordpress.org/support/users/mitcheljh/)
 * (@mitcheljh)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/ckeditor-with-multiple-comment-forms-only-first-instance-is-initialized/#post-4537588)
 * I found something that works for me.
    First, I disable the standard (tinymce)
   editor for bbpress, with the following:
 *     ```
       function my_bbp_use_wp_editor()
       {
       	return false;
       }
       add_filter( 'bbp_use_wp_editor', 'my_bbp_enable_visual_editor' );
       ```
   
 * Then, manually replace the bbpress editor with ckeditor.
    I did this at the bottom
   of ckeditor.config.js.
 *     ```
       CKEDITOR.replace('bbp_topic_content', ckeditorSettings.configuration);
       ```
   
 * The bbpress editor replaces the bbpress editor, with the same toolbar configuration
   used in the comments.
 *  Thread Starter [own3mall](https://wordpress.org/support/users/own3mall/)
 * (@own3mall)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/ckeditor-with-multiple-comment-forms-only-first-instance-is-initialized/#post-4537591)
 * Well, that didn’t work for me.
 * I’ve tried everything, and I’m still at square one.
 *  Thread Starter [own3mall](https://wordpress.org/support/users/own3mall/)
 * (@own3mall)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/ckeditor-with-multiple-comment-forms-only-first-instance-is-initialized/#post-4537595)
 * I added the following to the bottom of my ckeditor.config.js file:
 *     ```
       CKEDITOR.replace('lolzk', {
           toolbar: 'WordpressBasic' });
       ```
   
 * I told WordPress to write the comment field using an ID of lolzk. It is replaced
   by CKEditor, but in its full toolbar state. It will not use the default WordPressBasic
   toolbar group. Any idea why that’s not working?
 * If I use:
 * `CKEDITOR.replace('lolzk', ckeditorSettings.configuration);`
 * It gets replaced by a full CKEditor instance, not WordPressBasic or WordPressFull.
 * Please help! I’d like it to get replaced with the WordPressBasic toolbar group.
 *  Thread Starter [own3mall](https://wordpress.org/support/users/own3mall/)
 * (@own3mall)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/ckeditor-with-multiple-comment-forms-only-first-instance-is-initialized/#post-4537630)
 * Gave up on CKEditor, and I’m now using NicEditor for the comments. Here’s a guide
   that will walk you through it.
 * You can have CKEditor installed too for posts, but just make sure you disable
   it for comments in the plugin settings:
 * [http://blog.eamster.tk/multiple-comment-forms-on-wordpress-page-using-wysiwyg-editor-nicedit/](http://blog.eamster.tk/multiple-comment-forms-on-wordpress-page-using-wysiwyg-editor-nicedit/)

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

The topic ‘CKEditor with Multiple Comment Forms – Only First Instance Is Initialized’
is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ckeditor-for-wordpress_fbf8d9.svg)
 * [CKEditor for WordPress](https://wordpress.org/plugins/ckeditor-for-wordpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ckeditor-for-wordpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ckeditor-for-wordpress/)
 * [Active Topics](https://wordpress.org/support/plugin/ckeditor-for-wordpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ckeditor-for-wordpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ckeditor-for-wordpress/reviews/)

## Tags

 * [Ckeditor](https://wordpress.org/support/topic-tag/ckeditor/)
 * [comment](https://wordpress.org/support/topic-tag/comment/)
 * [form](https://wordpress.org/support/topic-tag/form/)
 * [forms](https://wordpress.org/support/topic-tag/forms/)
 * [multiple](https://wordpress.org/support/topic-tag/multiple/)
 * [page](https://wordpress.org/support/topic-tag/page/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * 7 replies
 * 3 participants
 * Last reply from: [own3mall](https://wordpress.org/support/users/own3mall/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/ckeditor-with-multiple-comment-forms-only-first-instance-is-initialized/#post-4537630)
 * Status: not resolved