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:
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.
- The topic ‘CKEditor with Multiple Comment Forms – Only First Instance Is Initialized’ is closed to new replies.