How to add Quicktags

Updated 16th May, and should now work fine with WordPress 2.2. Please report any bugs if found!

The Quicktags Plugin

In order to get the Quicktags add-on displayed above your comment form start by downloading a copy of comment_quicktags.zip, unzip it and upload the 2 files to your theme directory:

Download Download comment_quicktags version 1.1

Second, (-> WP2.1) add the following to your theme’s header.php:

<!-- Include the Comment Quicktags -->
<script src="<?php echo bloginfo('template_directory') ?>/quicktags.js" type="text/javascript"></script>
<script src="<?php echo bloginfo('template_directory') ?>/comment_quicktags.php" type="text/javascript"></script>

Then replace the existing textarea paragraph in your theme’s comments.php with this:

<p><script type="text/javascript">edToolbar();</script>
<textarea style="width:99%;" name="comment" id="comment" cols="70" rows="10" tabindex="4"></textarea>
<script type="text/javascript">var edCanvas = document.getElementById('comment');</script></p>

Finally, open styles.css in your theme’s folder and add the following lines (anywhere):

/*** QuickTags on Comments (Plugin styling) ***/
#commentform #ed_toolbar input.ed_button { width:auto; }

Enter one of your posts and refresh your browser window. You should now be able to see the Quicktag add-on above the textarea where comments are entered.

3 thoughts on “How to add Quicktags

  1. Pingback: Blogvaria » Blogvaria Plugins

  2. Pingback: Blogvaria » Upgrading to Wordpress 2.2