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*

Put the number of comments in the preview

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #67933
    Alberto
    Participant

    Hi, I want to show the number of comments for each preview where the red arrow is. What modification should I make?

    Schermata-2019-09-14-alle-00-38-40

    #68273

    Hi Alberto,

    Apologies for the late reply. We missed your topic.
    Anyways for this it needs code customization and you need to hire a developer as this is a new feature to add in the theme.

    Thank you!

    #68274
    Alberto
    Participant

    Okay, tell me the files to edit that I do it

    #68453

    Hi Alberto,

    You have to customize the wp_portfolio_theloop_for_archive() function code which is in file inc > structure > content-extentions.php on line no: 133
    Make sure you have created a child theme for customization so that your customization won’t lost after update.

    Thank you!

    #68479
    Alberto
    Participant

    I put this code in the file you told me, line 147, you can see here https://albertifoto.altervista.org
    I would have liked to add the link to the comments, but I failed.
    I tried the code in the child functions.php but it doesn’t work.

    <div class="commenti-anteprime">
       <?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>');
       }
       ?>
     </div>
    #68631
    Alberto
    Participant

    SOLVED!

    Now there is also the link:

    <?php
       if (1 == get_comments_number()) { 
            printf(__('<a href="' . get_permalink() . '#comments"> 1 commento</a>', 'wp-portfolio') , number_format_i18n(get_comments_number()));
        }
        else { 
            printf(__('<a href="' . get_permalink() . '#comments"> %1$s commenti</a>', 'wp-portfolio') , number_format_i18n(get_comments_number()));
        }
     ?>
    #68674

    Hi Alberto,

    Great that you solved it.
    If you have any problem do not hesitate to contact us.

    Thank you!

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