Support » Fixing WordPress » “Comments Off”

  • Resolved tmcgonegal

    (@tmcgonegal)


    Under each blog post, in addition to the words “Posted in xxxx”, my blog displays “Comments Off”.

    Since I have comments turned off for all posts by default, I’d kinda like to get rid of the “Comments Off” indicator. Can anyone suggest how I can do this?

    Thanks,

    Tom

Viewing 15 replies - 1 through 15 (of 18 total)
  • go through your theme files, and locate all the occurances of :

    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>

    Removing that bit ought to remove all the stuff related to comment counting.

    Thread Starter tmcgonegal

    (@tmcgonegal)

    I’m not sure I worded my post correctly based on your reply.

    I’d like to remove the words “Comments Off” that appear under each post.

    Thanks,

    Tom

    i understood your question. Did you understand my reply?

    What I pasted is responsible for what you are describing.

    Thread Starter tmcgonegal

    (@tmcgonegal)

    Thank you for the affirmation. No, I did not understand your reply. Now I do. I use the Default theme. I just checked, and under it are 2 folders and about 18 files. Do I need to check the files under the 2 folders (_vti_cnf & images) or just the 18 under the root defaults directory?

    When you say remove that “bit”, I am not sure what you mean. Do you mean I should remove that whole string of characters you have specified?

    Thank you,

    Tom

    (_vti_cnf & images) those arent theme files.

    All you need to pay attention to are the .php files.

    Thread Starter tmcgonegal

    (@tmcgonegal)

    When you say remove that “bit”, I am not sure what you mean. Do you mean I should remove that whole string of characters you have specified?

    Thank you,

    Tom

    Thread Starter tmcgonegal

    (@tmcgonegal)

    There are 16 php files contained within the defaults theme folder. I copied and pasted the above character string you provided me into the Firefox FIND search box for each of the 16 files, after I opened each one in turn.

    I found no hits. Am I doing this correctly? I am using 2.3.3.

    Thanks,

    tom

    3 files contain similar or identical code:

    search.php:

    <small><?php the_time('l, F jS, Y') ?></small>
    <p class="postmetadata"><?php the_tags('Tags: ', ', ', ''); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
    
    </div>

    index.php:

    </div>
    <p class="postmetadata"><?php the_tags('Tags: ', ', ', ''); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
    
    </div>

    archive.php:

    </div>
    <p class="postmetadata"><?php the_tags('Tags: ', ', ', ''); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
    
    </div>

    removing these exact bits will probably cause issues with the theme display, fwiw. I pasted more than what was necessary, just to make it easier for you to locate.

    Thread Starter tmcgonegal

    (@tmcgonegal)

    Thank you again. Can you tell I am a novice? 🙂

    I am not anxious to cause an issue with my theme display, so may I be so bold as to ask a question? If you were to have instead posted only the what was necessary for me to delete, would that still cause issues with my theme display?

    Assuming an answer of “no”, would you be so kind as to paste only what is necessary for me to delete?

    Based on your earlier post, I’m guessing it’s just this part?

    <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?>

    Thank you,

    Tom

    whooami

    (@whooami)

    thats correct. and deleting just that bit *shouldn’t* break the theme layout.

    *there is always room to be wrong.

    Thread Starter tmcgonegal

    (@tmcgonegal)

    Holy cow!! It worked!! You REALLY know this product, don’t you? I neither know this product nor anything about PHP, but was able to follow your instructions and got the desired results.

    I learned from your tip and took it one step further. After applying your recommended changes, I was left with “Posted in Category-name |”. By searching the same 3 files for Posted, I was able to delete the “|” character following “Posted in Category-name”.

    Thank you very, very much.

    Tom

    intricateartist

    (@intricateartist)

    Can the “comments off” text be removed/altered without removing the call to the comments count/link?

    @intricateartist Yes

    <?php comments_popup_link('Leave a comment &raquo;', '1 Comment &raquo;', '% Comments &raquo;', '', 'comments off'); ?>

    Displays following:

    if no comments, displays –> Leave a comment »
    if 1 comment, displays –> 1 comment »
    if more than one comment (e.g. 5), displays –> 5 comments »
    css class –> not defined
    if comments are off, displays –> comments off

    So…put this in your template files and replace ‘comments off’ with whatever you want displayed (if nothing, leave blank but don’t remove the single quotes)

    Hi thejiggerypokery,

    For some reason the code does not contain ‘comments off’, yet in the blog it appears when I don’t allowe comments. The code looks like this:

    <?php
    // comments link
    comments_popup_link(
    __(‘No Comments’, ‘mandigo’). ‘ »’,
    __(‘1 Comment’, ‘mandigo’). ‘ »’,
    __(‘% Comments’, ‘mandigo’). ‘ »’
    );
    ?>

    What can I do to remove the text ‘Comments off’ from my blog?

    Travis

    (@cellphonetrek)

    Hi guys,
    I tried to follow the solution suggested for removing comments. I opened my archives, index and search and removed the bit as told above. Unfortunately upon doing so my site will not load. The admin panel still works, which leads me to believe something is amiss in the index. The site is http://www.cellphonetrek.com

    I loaded my backup files and still see a blank page at the root of my site.

    Any help would be appreciated, thanks!

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘“Comments Off”’ is closed to new replies.