Remove "no comments" comment when comments are not allowed

Posted in: Newspaper
Post count: 73

Hi,

I would like to allow comments on certain posts and not on others.

This works fine and I can set each individual post to allow comments or not.

However – when I do not allow comments a line that says “no comments” appear. I would much prefer that nothing was showing when comments are not allowed.

See printscreen of what I mean here: http://www.screencast.com/t/P73flbrq7eh

Is there a way to remove this?

Best wishes
Lars

Post count: 22421

Hi,

Unfortunately there is no setting for this, but it can be done by adding an extra condition in the php files.
Please replace this part: http://screencast.com/t/AiASlqmqEd with this code:

if ($num_comments > 0){  ?>
<div class="td-comments-title-wrap <?php echo $td_css_cls_pb_padding_side ?>">
<h4 class="<?php echo $td_css_cls_block_title ?>"><span><?php echo $td_comments_no_text?></span></h4>
</div>
<?php }; ?>

It should look like this:
http://screencast.com/t/UW6NlpRg55e

Thank you!

Post count: 73

Thanks. That kind of works but it seems to cause a bigger problem.

It caused all the content in my posts that are under “wp text blocks” to disappear. Example: http://www.screencast.com/t/Pj9WyptbP

So I needed to put the old code back.

Best wishes
Lars

Post count: 22421

Hi.

It seems I forgot the php tag. Sorry :).

Please try this code:

<?php
        if ($num_comments > 0){  ?>
        <div class="td-comments-title-wrap <?php echo $td_css_cls_pb_padding_side ?>">
            <h4 class="<?php echo $td_css_cls_block_title ?>"><span><?php echo $td_comments_no_text?></span></h4>
        </div>
    <?php }; ?>

Thanks.

Post count: 73

Now it works. Thanks!

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