• Resolved kbgraphic

    (@kbgraphic)


    Hi, i need your help please;;;
    i wan to show label if just post (custum post type) are commented by current logged user:

    <?php
    $args = array(
    ‘post_type’ => ‘custom-post-type’,
    ‘user_id’ => $current_user->ID
    );
    $number = get_comments_number($args);

    if($number == 0) {
    echo ‘no comments’;
    } else {
    ?><span class=”label”>commented</span>
    <?php } ?>

    thank you so much in advance

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi,

    You have to use get_comments instead of get_comments_number as it do not accept array of augments which are you are providing.

    Not sure if you solved this, but just as Sumit said, maybe give this gist a try.

    Cool! the perfect gist. @kbgraphic please mark as resolved if you solved this.

    Sumit Singh, my name is Serge Sira. i am trying to do a simple thing but I am stumped…perhaps you can assist me…I am trying to get the Social Icons in the home page of my website (sergesiracommunityoutreach.com) to link up directly with their respective accounts. for example, facebook icon should link to my facebook account. it does not do so. do you know how to do that?

    Sumit Singh, resolved on my end but thanks for your consideration re same. I would like your input on how to cross reference my other website (www.khaliliansira.com) in the footer of this sergesiracommunityoutreach.com website. Your suggestions would be welcome. Serge Sira.

    Hello Serge Sira,

    Sure! but you need to create a separate topic for this as per forum rules. Using the Support Forums

    @kbgraphic
    Thank you! but forum rules do not allow us to share contact info so i am sorry regarding this. You can always use support forum for your every question.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘show label on post if commented by current user’ is closed to new replies.