Posted by José Lopes.
This plugin provides an easy way to have the comments hidden by default, with a link to show the comments when requested by the visitor.
The objective of such functionality aims to focus the visitor attention on the post content.
In fact a large number of visitors just want to read the post and not the comments, but if they do want to read
or leave their own comments they have the link to click and see them.
All the comments block stays hidden while using this Plugin, considering as comments block the comments list and form to
leave a comment.
In its place the sentence 'Click here to see or add comments' will appear.
A visitor clicking in this sentence will make it go away, being replaced by the comments block. Once clicked the sentence will not return and the comments block will stay unless a page refresh is done.
To see this Plugin in action you can see the paleografia.org web site, at the bottom of the post. Note that this site is in Portuguese but you can see how the Plugin works with the 'Clique aqui para comentar ou ver comentários a este artigo' sentence at the bottom.
Download
You can download one of the files that serves you better:
You may also find this Plugin in the Wordpress repository at Hide or Show Comments
Installation
How to use it
Once active you have to do one thing to have it working.
The file single.php defines how to show the post itself, including the add comments form and list.
In this file you have to replace <?php comments_template(); ?> by <?php hideshowComments(); ?>. Now its done!
Final notes
This Plugin was tested with Wordpress v.2.2, so any info about other version is welcome.
There are no special requirements to install this Plugin, but to use it is necessary that the visitor's browser has the javascript activated.
This Plugin (in English by default) includes portuguese (Portugal) and french (France) versions, through the files with
.mo extension available on the distribution.
The file hideshowcomments.pot allows the translation to any other language, that can be done easily since there is only one
sentence to translate.
I leave the request for anybody adding a new language to send us the file so we can make it available to others.
Deixe a sua mensagem:
Great plug-in. Just wondered.. how would i make the link so that it would hide the comments as well.
At the moment, it only shows them.
thanks a lot for your help!