BuddyDev

Search

hiding comments

  • Participant
    Level: Enlightened
    Posts: 36
    rav on #29410

    Hey
    I have a problem hiding comments in the activity stream.

    I changed the js code
    in “buddypress.min.js” in two places.
    like here: https://kainelabs.ticksy.com/article/14148
    Everything works until I go to the bottom of the stream and new posts are loaded. then the comments are no longer hidden. Please help

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #29411

    Hello Rav,

    Thank you for posting. There are other better ways to hide activity comments in the activity stream.
    BuddyPress offers “display_comments” feature to hide activity comments. Please check the following example which will hide comments on activity directory page.

    
    add_action( 'bp_after_has_activities_parse_args', function ( $r ) {
    
    	if ( ! bp_is_activity_directory() ) {
    		return $r;
    	}
    
    	$r['display_comments'] = false;
    
    	return $r;
    } );
    

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 36
    rav on #29417

    Hello,
    Thank you for your response.
    Unfortunately, the code you have published does not work for me.
    Comments still show up after loading more posts.

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #29418

    Hi Rav,
    Are you using Youzer or is it default BuddyPress template pack? Which template pack you are using? Bp Legacy or Nouveau?

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 36
    rav on #29419

    Hello Brajesh Singh,
    I don’t use Youzer. I’m using the standard version of buddypress 5.2 with the Nouveau template

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #29423

    Hello Rav,

    Thank you for the acknowledgement. Please let me know in which file you place this code. Also, which activity page like Activity directory, Member’s activity page or Group’s activity page you are trying to disable comment.

    Please share the code you are using.

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 36
    rav on #29431

    Hi Ravi

    I added code into functions.php in my child theme.
    I’m trying to get the effect of hiding comments in a member’s activity
    I used the code you sent me a few messages earlier (yesterday).

    • This reply was modified 3 years, 11 months ago by rav.
  • Participant
    Level: Enlightened
    Posts: 36
    rav on #29433

    I have tried something like this but it deletes comments (does not collapse) and the same stream posts are still loading

     
    function hide_comments(){
    
            if ( ! bp_is_activity_directory() ) {
    		return $r;
    	}
    
    	$r['display_comments'] = false;
    
    	return $r;
    }'
    
    add_action( 'bp_after_has_activities_parse_args', 'hide_comments');
    
    • This reply was modified 3 years, 11 months ago by rav.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #29439

    Hello rav,

    Thank you for the acknowledgement. It seems you have some modification. I will look into it and will update you with the code.

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 36
    rav on #29440

    Hello
    I also use a plugin to build a global activity stram BP Profile Activity Wall
    By Venutius. It’s a bit old but I don’t know an alternative to it. I thought maybe this is causing the problem but when turned off it is still the same.

You must be logged in to reply to this topic.

This topic is: not resolved