WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was wondering if anyone knew of a way to show specific styles to the activity loop depending on the activity type?

This is what I had an idea of:

function mycustom_act_type() {
if ('friendship_created' != bp_get_activity_type() )
echo ' style="background:red;" ';
}

and this is in the <li> whithin the loop:

<li <?php mycustom_act_type()?> >blah </li>

but obviously doesn't work. Any ideas?

share|improve this question

closed as off-topic by birgire, ialocin, toscho Aug 6 '14 at 18:44

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

Looking at http://testbp.org/activity/, that activity feed has classes on each list item indicating the activity type. If you can look at that theme, I suspect you'll find the code to add the right class for your styles.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.