Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: how to have comment and replies collapse and expand.

@timothyjunior

Participant

ok, break out notepad++ or any text editor and make back ups these two files:
– /wp-content/plugins/buddypress/bp-themes/bp-default/activity/entry.php
-/wp-content/plugins/buddypress/bp-themes/bp-default/header.php

add this to your header.php file within the head section :
`

`

now locate entry.php and replace : `

`
with this code :
`

$(document).ready(function(){

$(“li#activity- div.activity-comments ul”).hide();

$(“li#activity- a.acomment-reply”).click(function(){
if ( $(“p.collapse-“).css(“display”) == ‘none’ ){

$(“p.expand-, p.collapse-, li#activity- div.activity-comments ul”).toggle(100);

}
return true;
});

$(“p.expand- a”).click(function(){

$(“p.expand-, p.collapse-, li#activity- div.activity-comments ul”).toggle(100);
return false;

});

$(“p.collapse- a”).click(function(){

$(“p.expand-, p.collapse-, li#activity- div.activity-comments ul”).toggle(100);
return false;

});

$(“li#activity- input[name=ac_form_submit]”).click(function(){

if ( $(“p.collapse-“).css(“display”) == ‘none’ ){

$(“p.expand-, p.collapse-, li#activity- div.activity-comments ul”).toggle(100);

}
return true;
});

});

`

heres a little css to work with:
`.expandable {
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
background: none repeat scroll 0 0 #F4F6F8;
border: 1px solid #EEEEEE;
margin-bottom: 2px;
text-align: center;
text-shadow: 1px 1px 1px #FFFFFF;
}

.expandable p {
margin: 0px;
}`

remember to always back up your files, hopefully someone makes a plugin with this functionality so we can stop messing with the core of buddypress.

*Can’t believe that took me 5 hours lol

Skip to toolbar