badget

Black Friday, Cyber Monday Deal!

Get 30% discount in all of our single theme until December 13 with coupon: BLACKCYBER

Code with "zero" comments

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #68645
    Alberto
    Participant

    Let me explain better, in the wp-portfolio / comments.php line 26-> 35 file there is this code:

    <h2 class="comments-title">
        <?php
      if (1 == get_comments_number()) {
        printf(__('One thought on &ldquo;%2$s&rdquo;', 'wp-portfolio') , number_format_i18n(get_comments_number()) , '<span>' . get_the_title() . '</span>');
      }
      else {
        printf(__('%1$s thoughts on &ldquo;%2$s&rdquo;', 'wp-portfolio') , number_format_i18n(get_comments_number()) , '<span>' . get_the_title() . '</span>');
      }
    ?>
      </h2>

    But I don’t understand where is the code that puts on “0 comments” because I would like to modify the text.
    I put the code in another file (inc/structure/content-extentions.php) and you can see below the thumbnails of my site https://albertifoto.altervista.org

    #68679

    Hi ALberto,

    Where you are getting 0 comments into your site?
    WP core function get_comments_number() retrieves the amount of comments a post has, if there are no comments it return 0.
    You can see the function description here.

    Thank you!

    #68681
    Alberto
    Participant

    SOLVED!

    I made a small change to my code.

    #68702

    Thats Great! If you have any problem do not hesitate to contact us.

    Thank you!

    #72049
    Đông Phương
    Participant

    tks for sharing!!!!

    #72063
    mrryfior
    Participant

    Test

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.