BuddyDev

Search

[Resolved] Change Number of Comments Shown by Default in Activity Stream

  • Participant
    Level: Enlightened
    Posts: 83
    Princy Cromacio on #41101

    Hey There,
    I Want to Change the Number of Comments shown by Default in BuddyPress from 5 to 2 or 1.
    I Have Tried Editing Global.js And Buddypress.js but Couldn’t See Any Effect in Activity Feed’s Updates, Neither on Profile’s Feeds.

    Here’s A Copy of What I Have Changed-

    /* Hide long lists of activity comments, only show the latest five root comments. */
    function bp_legacy_theme_hide_comments() {
    	var comments_divs = jq('div.activity-comments'),
    		parent_li, comment_lis, comment_count;
    
    	if ( !comments_divs.length ) {
    		return false;
    	}
    
    	comments_divs.each( function() {
    		if ( jq(this).children('ul').children('li').length < 1 ) {
    			return;
    		}
    
    		comments_div = jq(this);
    		parent_li = comments_div.parents('#activity-stream > li');
    		comment_lis = jq(this).children('ul').children('li');
    		comment_count = ' 1 ';
    
    		if ( jq('#' + parent_li.attr('id') + ' li').length ) {
    			comment_count = jq('#' + parent_li.attr('id') + ' li').length;
    		}
    
    		comment_lis.each( function(i) {
    			/* Show the latest 5 root comments */
    			if ( i < comment_lis.length - 1 ) {
    				jq(this).hide();
    
    				if ( !i ) {
    					jq(this).before( '<li class="show-all"><a href="#' + parent_li.attr('id') + '/show-all/">' + BP_DTheme.show_x_comments.replace( '%d', comment_count ) + '</a></li>' );
    				}

    I Would Be Happy to be Assisted if There’s Anything Else I Need to Do.

    Hope, Will Find a Solution For That.
    Thanks in Advance..!! 🙂
    Cheers, Cromacio

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #41116

    Hi Cromacio,
    Welcome to Buddydev.

    Thank you for the question. The answer will depend on which theme and template pack are you using. Please share the details and I will assist.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 83
    Princy Cromacio on #41128
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 83
    Princy Cromacio on #41129
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 83
    Princy Cromacio on #41141

    Hi Brajesh,
    Thanks For Your Reply.
    Just Here to Tell that I Got It Solved by Raising a Ticket at Wbcom Designs Support. 🙂

    Thanks, Cromacio

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #41153

    Hi Cromacio,
    Thank you.

    it’s good to know that you got it resolved.

    Thank you for letting me know.

    Regards
    Brajesh

The topic ‘ [Resolved] Change Number of Comments Shown by Default in Activity Stream’ is closed to new replies.

This topic is: resolved