BuddyDev

Search

Comment Rankings or Organization under a Post – large amount of comments

  • Participant
    Level: Initiated
    Posts: 12
    Colleen Alexander Sankey on #40817

    Hi Team!
    I was wondering if there was a plug-in or something for the following situation I have:

    So we have a buddyboss private group located on our website (not the app) as you know and we have a couple posts where people comment under these posts every single day so the quantity of comments add up. For example, right now we have one post that has 2,800 comments under it! 2,800! Right now, in our group, any given posts only shows the last 3 comments, then the user has to click “view more comments” to see more comments. When the user clicks “view more comments” it displays all the comments from the very first comment, which then requires a lot of scrolling to get down to the most recent comments. Is there a way to show most recent comments? or when someone clicks “view more comments” could it bring out like 20 most recent comments at a time or any solutions for something like this?
    Thank you so much! I appreciate this forum!
    Colleen

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

    Hi Colleen,
    Thank you for the question.

    It’s amazing to know that single posts have that many comments. That’s wonderful.

    Please allow me to look into it tomorrow and hopefully there will be a solution.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 12
    Colleen Alexander Sankey on #40830

    Hi Brajesh! Yes, I can even attach pics if there is a way but yeah. Okay thank you for looking into!
    Have a great night (or day),
    Colleen

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #40831

    Hello Colleen,

    Please try the following code and check if it accomplish your requirement or not.

    
    add_action( 'pre_get_comments', function ( $comment ) {
    	$comment->query_vars['orderby'] = 'comment_date_gmt';
    	$comment->query_vars['order']   = 'DESC';
    } );
    
    

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 12
    Colleen Alexander Sankey on #40839

    Hi Ravi!
    Thank you so much, I am going to give this to my web guy to add in and see how it goes! I will update you!
    Thank you,
    Colleen

You must be logged in to reply to this topic.

This topic is: not resolved