• Hi,

    I’m trying to figure out how to remove the comments off button on our blog. According to some of our visitors, the “off” button confuses them. I’d like to remove it, but I still want to keep the “comments” button. In other words, when comments are allowed, I’d like to keep it as it is.

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • try and edit index.php (or the template file that shows your front page);
    find something like:

    <div class="comments">
    
    									<span>off</span>
    								</div>

    (the code inbetween the top and bottom line will be much more complex in your file;
    if you need help identifying the right area, you could paste the code of your file into a https://wordpress.pastebin.com/ and post the link to it here)

    then wrap it into a conditional statement:

    <?php if ( comments_open() ) : ?>
    <div class="comments">
    
    									<span>off</span>
    								</div>
    <?php endif; ?>

    Thread Starter prodentite

    (@prodentite)

    alchy,

    Thanks for your help!

    I’m guessing that the comments.php page is where I can make the modification…

    Here’s the code

    no, this is not it.
    try index.php.

    Thread Starter prodentite

    (@prodentite)

    Ah… forgot to look in the wp-content folder.

    index.php

    Thanks,

    this is the right file:

    so, edit this index.php, find:

    <div class="comments">
    
                                                                            <?php comments_popup_link('Comments (0)', 'Comment (1)', 'Comments (%)', '' , 'off'); ?>
    
                                                                    </div>

    change to:

    <?php if ( comments_open() ) : ?>
    <div class="comments">
    
                                                                            <?php comments_popup_link('Comments (0)', 'Comment (1)', 'Comments (%)', '' , 'off'); ?>
    
                                                                    </div>
    <?php endif; ?>
    Thread Starter prodentite

    (@prodentite)

    Alchymyth,

    SWEET! Thanks so much for your help!!!!

    Chris

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How do I remove "comments off" button on my blog?’ is closed to new replies.