0

I have too many posts on one post ID.

I'd like to remove the actual contact form but keep the comments.

I was thinking that this would work but it doesn't.

I know that I am doing something very simple.

body.postid-5 .comment-respond {
display: none;
}

And here's the actual HTML

<div class="comment-respond" id="respond">
    <h3 class="comment-reply-title" id="reply-title">Leave a Reply <small><a href="/tools/top-ten/#respond" id="cancel-comment-reply-link" rel="nofollow" style="display:none;">Cancel reply</a></small></h3>
    <form action="https://www.example.com/wp-comments-post.php" class="comment-form" id="commentform" method="post" name="commentform" novalidate="">
        <div class="comment-textarea">
            <textarea class="textarea-comment" cols="39" id="comment" name="comment" placeholder="Your Comment Here..." rows="4" tabindex="100"></textarea>
        </div>
        <div class="comment-form-author">
            <input aria-required="true" class="input-name" id="author" name="author" placeholder="Name (required)" size="22" tabindex="101" type="text" value="">
        </div>
        <div class="comment-form-email">
            <input aria-required="true" class="input-email" id="email" name="email" placeholder="Email (required)" size="22" tabindex="102" type="text" value="">
        </div>
        <div class="comment-form-url">
            <input class="input-website" id="url" name="url" placeholder="Website" size="22" tabindex="103" type="text" value="">
        </div>
        <p class="form-submit"><input class="submit" id="comment-submit" name="submit" type="submit" value="Post Comment"> <input id='comment_post_ID' name='comment_post_ID' type='hidden' value='5'> <input id='comment_parent' name='comment_parent' type='hidden' value='0'></p>
        <p style="display: none;"><input id="akismet_comment_nonce" name="akismet_comment_nonce" type="hidden" value="XXXX"></p>
        <p style="display: none;"><input id="ak_js" name="ak_js" type="hidden" value="62"></p>
    </form>
</div><!-- #respond -->

The actual HTML code on the page for the contact form is as follows:

1 Answer 1

0

If I understand correctly, you're trying to turn off the ability for users to add new comments on a single blog post. Is that right?

If so, instead of using CSS, I'd recommend using the built-in WordPress feature to turn off commenting for a single blog post. You'll find it within the "Discussion" section when editing the post. The option is called "Allow Comments". Uncheck that option, save the post, and you should be all set. Also, don't worry, you're existing comments should still appear.

Here's a screenshot of where the setting is in case you need it:

Allow Comments WordPress option

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.