WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Hide/remove "Leave a Reply" section (4 posts)

  1. snomead
    Member
    Posted 6 years ago #

    Hi,
    I'm trying to make a plug in to protect posts with a password (but without wp-pass) and I can correctly hide the comments (with add_filter('comments_array','my-function')) but I can't found any filter or action to hide the form.

    Thanks
    SnomeaD

  2. snomead
    Member
    Posted 6 years ago #

    Does anybody know ?
    I want not to modify the core (like comments.php), isn't any other way to do that ?

    Thanks,
    SnomeaD

  3. snomead
    Member
    Posted 6 years ago #

    Ok, I've manage to hide the "Leave a Reply" section with some jQuery. Not the best I've done ... but it's working :D

    function myplugin_hideCommentForm($id){
    
        if(!myplugin_allowDisplay($id)){
            echo "<script type='text/javascript' charset='utf-8'>
                jQuery(document).ready(function(){
                    jQuery('#respond').css('display','none');
                    jQuery('#commentform').css('display','none');
                    jQuery('.nocomments').css('display','block');
                });
            </script>";
        }
    }
    add_action('comment_form','smsprotect_hideCommentForm');
  4. maryandpaul
    Member
    Posted 5 years ago #

    After I press a post category, the posts for all that category, are displayed but the "Leave a Reply" section does not display until I press on the post "title" link. Is it possible to have the "Leave a Reply" comments section display when the post is originally displayed?

    Paul
    mabnbpdb@aol.com

Topic Closed

This topic has been closed to new replies.

About this Topic