Making the Compositio WordPress theme work with reCaptcha

In: Wordpress

Posted by Geries Handal

9 Mar 2009

The Compositio WordPress theme was design by Design Disease and brought to you, thanks to Smashing Magazine. Now that my blog is self hosted I decided to install the WP-reCaptcha plugin as a antispam measure for the comments. The plugin worked well with other themes, so that is how I new the problem was with the theme. Tried to fixed by myself, looking at the comments left in the plugins home page, however I couldn’t. So, I left a comment and Blaenk Denum was kind enough to help. Apparently is a common problem when the reCaptcha box doesn’t appear bellow the comments textbox.

The solution is to put

<?php do_action(‘comment_form’, $post->ID); ?>

in the comments.php file just before line 70 (or before </form> tag) for the Compsitio Theme, as stated by Bleank. For the other themes look for the </form> tag  and paste the code just before.

The code we insert, is call to a Action Hook. Based on the Theme Development guidelines there are some Plugin Api Action Hooks that should be included on all themes. These actions hook need to be present in the theme, for the Plugins to display information directly in the header, footer, sidebar, or in the page body. In the case of the comments the following is stated:

comment_form
Goes in comments.php and comments-popup.php, directly before the comment form’s closing tag (</form>). Example plugin use: display a comment preview.
Usage: <?php do_action('comment_form', $post->ID); ?>

For the case of the Compsitio theme, this line of code was only missing in the comments.php and was present in the comments-popup.php.

Comment Form

 

About this blog

A personal blog where I write about my current projects, work and interests. The posts are a reflection on my current self, varying over time, since change is the only constant.

Welcome to G To The Square, my thoughts on ICT, Business and Life... in a Square.