badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Code with "zero" comments

Viewing 4 posts - 1 through 4 (of 4 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!

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