BuddyBoss Home – Web › Support Forums › Plugins › BuddyBoss Wall › Hide and Show Comments on Wall and in Newsfeed
- This topic has 5 replies, 5 contibutors, and was last updated 5 years, 2 months ago by JMojonnier.
Question
April 19, 2016 at 10:09 am #68938Answers
April 21, 2016 at 2:31 am #69110@alyssa-buddyboss
AlyssaParticipantHwdy Kamil!
this should do the trick.
add_action( 'wp_footer', 'add_comment_hide_show' ); function add_comment_hide_show() { ?> <style> .activity-comments ul li[id^="acomment-"]{display: none;} </style> <script type="text/javascript"> jQuery(function($) { setInterval(function() { $('.activity-meta').each(function() { if( !$(this).find('.show-comments').length ){ var html = '<a href="#" class="button bp-primary-action show-comments">Show/Hide Comments</a>'; $(this).find('.button.acomment-reply').after(html); } }); }, 500); $('body').on('click', '.show-comments', function(e) { e.preventDefault(); var obj = $(this).closest('.activity-content').next('.activity-comments').find('ul li[id^="acomment-"]'); obj.slideToggle(); return false; }); }); </script> <?php }
Cheers!
April 21, 2016 at 3:04 am #69116@madmax94Thank you for the answer 😀 .
The code works but if there are more than 5 comments for e.g. 8 , the last 3 comments are not hidden.
With the old code all comments are hidden.
———–
And is there an option that all comments are shown because if i use the code (the old code) all commets are hidden but only the first 5 comments be displayed if i click on show. To see all commets i have to click after that on show all (e.g.) 8 comments.Thanks 🙂
April 21, 2016 at 9:04 pm #69228@
AnonymousHi @madmax94,
These are small customization you can easily use your developer or 3rd party service to do them
For small customization you can also use https://codeable.io/Regard
Varun DubeyMarch 12, 2018 at 7:57 am #138918@bryceevansIs there an updated version of either of these codes?
Neither of them seem to work for me with Boss Theme and Wall plugin.
August 26, 2019 at 10:45 pm #201186@jmojonnierThis works great until someone Likes a post, then Show/Hide freezes for the rest of the page. Any ideas what might be causing that?
- You must be logged in to reply to this question.