Tagged: activity, buddypress, comments, stream
Hi brajesh im back with another feature request 🙂
Right now a single activity will show 10 or more comments depending on the amount of comments which is not a good user experience.
Is it possible to show only two comments at first and then show a link to “view all comments” just like how facebook does.
Right now latest activity updates are lost due to the long comments list.
I hope you understood what im trying to say. Hope you consider this requestHi Arvind,
It is theme dependent. Please look for thisbp_legacy_theme_hide_comments
in your buddypress.js and you will see the default is set to 5. You can update it there.
Hope that helps.
Thank you so much Brajesh! 🙂
And i am sharing a code for hiding and showing comments which i found in the buddypress support page:
so that after viewing the 100’s of comments you can hide it! 🙂add_action( ‘wp_footer’, ‘add_comment_hide_show’ );
function add_comment_hide_show() {
?>
<style>
.single-group .activity-comments ul{display: none;}
</style>
<script type=”text/javascript”>
jQuery(function($) {
setInterval(function() {
$(‘.activity-meta’).each(function() {
if( !$(this).find(‘.show-comments’).length ){
var html = ‘Show/Hide Comments‘;
$(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’);
obj.slideToggle();
return false;
});});
</script>
<?php
}If you remember my previous post of how to tweak activity meta , can you please share that code so that i can put all the secondary buttons inside a drop down box ?
Hi Arvind,
Please take a look at your theme’s activity/entry.php . All the button comes from the div ‘activity-meta’So, except the 2 buttons, put everything in your dropdown and then it should work.
Thanks Brajesh but i dont see a delete button inside the entry.php , the only thing i ca see is this
<?php if ( bp_activity_user_can_delete() ) bp_activity_delete_link(); ?>and the edit button comes from a different plugin so that is also not visible in entry.php
I will find another solution 🙂 but i need your help
I want to create buttons like messages , notification , profile and when user clicks on message or notification button it redirects them to their corresponding pages. Like if the user click message button it takes him to his message page .
You must be logged in to reply to this topic.