How to Remove “Comments are Closed” in my site?
-
Hi,
I had this “Comments are closed” at the bottom of all my posts. I had check through the wp/include and
<p><?php comments_popup_link(‘No comments yet’, ‘1 comment so far’,
‘% comments so far (is that a lot?)’, ‘comments-link’, ‘Comments are
off for this post’); ?></p>change all the necessary fields between the ‘comments’ to empty field. But yet, I can’t seem to get rid of all these “comments are closed” words.
Anybody can help? By the way, the url i am referring to can be see at
This is the Herbal Remedies Pages
-
Line 164, comments.php, in the Atahualpa theme folder;
<?php // END of "If comments are open, but there are no comments" else : // If comments are closed: ?> <p><?php _e('Comments are closed.','atahualpa'); ?></p> <?php endif; ?>
…change/remove only the obvious.
If you look in the wp-comments-post.php in the WordPress root, Line 15 says-
die( __('Sorry, comments are closed for this item.') );
I believe this is what you are looking for. Good luck.
[Sig Moderated. Please Don’t…]
Just an update…
I think the correct way to do this, with this theme, (which I happen to think is friggin’ great, by the way!)may be to go the theme options page titled “Post/Page Info Items”, and remove or modify the comments from the footer on both single and multi post pages as you see fit.
Hi Clayton,
I have already deleted everything in the Post/Page Info Items beforehand. Now that you mentioned, I went to check it, and it’s all empty. So I think it’s not that area.
As for the comments.php, I have deleted the file the first time I setup the theme as I did not want any comments. I found another file called comment.php (without the s) in my wp-include folder dir. But still, I can’t find any “comments are closed” to delete.
Hi Ranjit
Not sure where the file you told me is, but it seems the message is also quite different. “Comments are closed.” and “Sorry, comments are closed”Hmm, sorry I am quite new to wordpress. Anybody know where’s the error or do i need to reininstall the theme once more? I have search almost all the php files but just can’t find the words “comments are closed” exactly as it appears.
You need to be working in the theme’s files only. Don’t make those changes to, or delete any WordPress core files needlessly.
just can’t find the words “comments are closed” exactly as it appears.
If you are seeing “Comments are closed.” in black text on a white background, at the bottom of a post on a single page, below the post footer, and not in the footer bar, then I believe it is coming from here:
Line 164, comments.php, in the Atahualpa theme folder;
If you deleted it from the theme folder, I have no clue where it is comming from.<?php // END of "If comments are open, but there are no comments" else : // If comments are closed: ?> <p><?php _e('Comments are closed.','atahualpa'); ?></p> <?php endif; ?>
Remove Comments are closed. only and save the file. Leave the tick marks. It will look like this;
<p><?php _e('','atahualpa'); ?></p> <?php endif; ?>
You can also find that line of code in the “comments-paged.php” for the obvious reasons.
If you are seeing “Comments are closed” in the post footer area (inside the grey border). You can make changes from here;
go the theme options page titled “Post/Page Info Items”, and remove or modify the comments from the footer on both single and multi post pages as you see fit.
I’m out of ideas. Good luck.
You should check the WordPress codex for templating… It isn’t that hard. ??
[signature moderated]
In the latest version of Atahualpa you can remove the text ‘text_comments_are_closed’ by removing the following text in line 73 (at least that was the case in my installation):
71 <?php else : // If comments are closed: ?>
72
73 <?php echo $bfa_ata[‘text_comments_are_closed’]; ?>
74
75 <?php endif; ?>so the line 73 should look like this afterwards:
73 <?php echo $bfa_ata[”]; ?>
I had this issue on one of my sites. I found the phrase on the comments.php file in the theme folder.
I commented out the entire line as follows.Before:
<?php else : ?>
<p class=”nocomments”>Comments are closed.</p>
<?php endif; ?>After:
<?php else : ?>
<!– <p class=”nocomments”>Comments are closed.</p> –>
<?php endif; ?>That took care of it.
Hope that helps.
Pius
nigeriaworkers.comto me it works when I deleted
<h3 class=”cmnt_hdr”><?php comments_number(__(‘0 Comments…’), __(‘1 Comment’), __(‘% Comments…’)); ?></h3>
at comments.php, theme’s fileHope it helps
Soniai had same issue (with a different theme) with “Comments are closed” showing up on my pages, but i couldn’t find that phrase in any of the php files.
however, in the page.php file i saw this line referring to a comments function:
<?php comments_template(); ?>
i deleted this, and it removed the “Comments are closed” phrase.
if you need the full code i had, then let me know.
In the Atahualpa theme, this is what you have to remove:
The file is comments.php:
<?php else : // If comments are closed: ?>
<?php echo $bfa_ata[‘comments_are_closed_text’]; ?>Remove this only:
comments_are_closed_textThis fixed it for me.
Hé, you forgot the most simple thing ever! Just check out the source code of the page, and you see
<p class="nocomments">Comments are closed.</p>
. You just need to change the style.css file of your theme and add, at the bottom,.nocomments{display:none;}
! This is very simple and you don’t have to touch any WordPress file.Have a nice day ??
FélixHé, you forgot the most simple thing ever! Just check out the source code of the page, and you see <p class=”nocomments”>Comments are closed.</p>. You just need to change the style.css file of your theme and add, at the bottom, .nocomments{display:none;}! This is very simple and you don’t have to touch any WordPress file.
Have a nice day ??
FélixIt works for me, great and so simple!! Even my 5 years old brother could do this ??
Thanks
The way I solved this problem was to remove the entire comments section if comments are closed like so (from my theme’s comments.php file):
<?php if ('open' == $post->comment_status) : ?> <div id="comments"> <h3><?php comments_number('No Comment.', '1 comment so far', '% comments so far' );?></h3> <span class="add_your_comment"><a href="#respond">Add Your Comment</a></span> <div class="clear"></div> </div> <?php if ( have_comments() ) : ?> <ol class="commentlist"> <?php wp_list_comments('type=all&callback=mytheme_comment'); ?> </ol> <!--paged comment goes here--> <div class="comments_navi"> <div class="alignleft"><?php previous_comments_link() ?></div> <div class="alignright"><?php next_comments_link() ?></div> <div class="clear"></div> </div> <?php else : // this is displayed if there are no comments so far ?> <?php if ('open' == $post->comment_status) : ?> <!-- If comments are open, but there are no comments. --> <?php else : // comments are closed ?> <!-- If comments are closed. --> <p class="nocomments">Comments are closed.</p> <?php endif; ?> <?php endif; ?> <?php endif; ?>
Notice the entire section is encapsulated with:
<?php if ('open' == $post->comment_status) : ?> <!-- content here --> <?php endif; ?>
This way, if comments are disabled, nothing will show up at all. Crude, but effective.
For those who just want to disable the “comments are closed” text but still want to display the comments that were posted before the comments were closed, stick with editing out the paragraph that contains that phrase like so:
<!-- <p class="nocomments">Comments are closed.</p> -->
or with the CSS method others have mentioned:
.nocomments{display:none;}
I managed to remove the “comments are closed” box from pages on my site which I was developing on a test domain https://www.heloucou.com
I exported the content to another domain https://www.exclusivef1experiences.co.uk/wordpress but can’t seem to remove the message, even though it appears all the theme files are identical on the two sites.
I’ve spend HOURS trying to work out why. Any ideas?
The theme is piano black.
- The topic ‘How to Remove “Comments are Closed” in my site?’ is closed to new replies.