• I am curious as to how I would modify piano-blacks code specifically to remove “Comments are closed” from any page that I do not allow comments. I’ve tried searching the internet but none of the results apply to this particular theme.

    Any help would be greatly appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Are you only using comments on posts? If you want to completely remove comments from pages, you could delete line 28 from page.php:

    <?php if (function_exists('wp_list_comments')) { comments_template('', true); } else { comments_template(); } ?>

    If you are using any page templates, you would have to remove if from them too.

    But if you want to leave the comments in both pages and posts, and just remove that “Comments are closed” message, you could delete this chunk of code from comments.php:

    <div class="comment-closed" id="respond">
    <?php _e('Comments are closed.','piano-black'); ?>
    </div>
    
    <a href="#pngfix-right" id="back-top"><?php _e('Return top','piano-black'); ?></a>
    Thread Starter relentlessmilk

    (@relentlessmilk)

    Thank you jleuze. I will love you forever for this!

    LOL, no problem, glad to help!

    Hi JLeuze,

    Do you do a similar theme with lighter colors? (White lol)

    Or if you could point out how to change the code colors I could have a go, no code monkey however.

    Hi Jump, from looking at the theme I think you’d have to replace a lot of graphics and change a lot of color values.

    It could be done, but I’d suggest browsing through the light and white theme directory tags to find something that is more suitable out of the box.

    There is an elegant solution for this.

    /themes/piano-black/index.php
    Line 28, 155th character.

    You see comments_popup_link function from wordpress has 3 arguments given, each of them functions. However this function takes 5 arguments.
    The 4th is a CSSStyle, the fifth is the responsible closed option.

    So simply extend, let 4th argument be 0, and fifth an empty string.
    so it looks like this at the end:
    .. piano-black'),0,''); ?>
    That should do the trick. The most proper solution is to write a __(); function here tho …`

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How can I remove “Comments are closed.”’ is closed to new replies.