Support » Plugin: Hide or Show Comments » [Plugin: Hide or Show Comments] Adding some jquery effect

  • I’ve added some jquery efefect to slide down the comments:

    • Add <script src=""></script> to header.php
    • Then I fixed the code bellow
    Plugin Name: Hide or Show Comments
    Plugin URI:
    Description: Hides the comments by default and allows to show or hide them on request.
    Version: 2.0
    Author: José Lopes
    Author URI:
    This plugin provides an easy way to set the comments hidden as default, with
    a link to show and hide back again the comments when requested.
    /*	Copyright 2007 Jose Lopes (email:
    	This program is free software; you can redistribute it and/or modify
    	it under the terms of the GNU General Public License as published by
    	the Free Software Foundation; either version 2 of the License, or
    	(at your option) any later version.
    	This program is distributed in the hope that it will be useful,
    	but WITHOUT ANY WARRANTY; without even the implied warranty of
    	GNU General Public License for more details.
    	You should have received a copy of the GNU General Public License
    	along with this program; if not, write to the Free Software
    	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    function hideshowComments () {
       $linkText1 = __("Click here to see the comments", "hideshowcomments");
       $linkText2 = __("or add a new comment", "hideshowcomments");
       $relinkText = __("Click here to hide again the comments", "hideshowcomments");
       echo "<script type=\"text/javascript\">
    var currLayerId = \"show\"; 
    function togLayer(id)
    <div style=\"background: #E0DDCF; border-top: 1px solid darkred; border-bottom: 1px solid darkred; margin:5px 20px 5px 20px;\">
    <br />
    <a href=\"\" style=\"text-decoration:none\" onclick=\"togLayer('hide');return false;\" title=\"\">",
    $linkText1, " (", comments_number('0','1','%'), ") ", $linkText2,
    <div id=\"hide\" style=\"display: none;\">
    ", comments_template(), "</div><br /> </div>";

  • The topic ‘[Plugin: Hide or Show Comments] Adding some jquery effect’ is closed to new replies.