Comments disabled on post, but no message displays

Posted in: Newspaper
Post count: 49

Hello,
Our comments are usually allowed for new posts, but on some, they are disabled on purpose.
Example here.
However, on a post with disabled comments, the comment div is empty when it renders as html:
<div class="comments" id="comments"></div>
In the comments.php, there is this code:

if (!comments_open() and (get_comments_number() > 0)) { ?>
	            <p class="td-pb-padding-side"><?php _etd( 'Comments are closed.', TD_THEME_NAME ); ?></p>
	        <?php }

This means that the comments div should have at least the ‘Comments are closed’ message.
I looked in the Translations section in the Theme Panel, but I couldn’t find anything that relates to ‘Comments are closed.’
My goal is to see ‘Comments are closed’ or ‘disabled’ on posts that don’t allow comments.
Any ideas?
Thanks in advance.

Post count: 20688

Hi,

If the post would have more than 0 comments the message will be displayed (get_comments_number() > 0)).

You could remove that second condition – https://www.screencast.com/t/jgZqmJ4J27
Then once you disable the comments per post – https://www.screencast.com/t/0R5c1hWALd9j
It will not matter if the post had comments or not.

I tested with a default WordPress theme and it is the same. If the post has no comments the message is not displayed, if it has at least one comment the message appears.

Thanks

Post count: 49

Thank you. That worked great.

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.