Forum Replies Created
-
I would be interesting in knowing the answer to this questions as well.
@prashantvatsh Sorry to bother you, but I tried the following solution, and it is still not working:
First, I added the following code to my bp-custom.php file:
<?php //The following creates avatar class in activity stream //based on x-profile field data function buddydev_create_avatar_class_based_on_field_data() { $user_id = bp_get_activity_user_id(); $title = xprofile_get_field_data('25', $user_id); // field ID or name $title = strtolower( $title ); $class = $title.'avatar'; echo $class; } add_action( 'create_activity_avatar_class_based_on_field_data', 'buddydev_create_avatar_class_based_on_field_data', 10, 1 ); ?>
Then, I added the following as a class inside the div tag for activity avatar in my buddypress/bp-templates/bp-legacy/buddypress/activity/entry.php file:
<?php do_action( 'create_activity_avatar_class_based_on_field_data'); ?>
Yet still it is not working. Did I put the do_action in the wrong file?
@prashantvatsh it seems that I need to give activity avatar’s class based on field data so that they will take the css change as well. How and where do I update the php so that the Activity avatars receive a new class based on field data?
Thanks again, @prashantvatsh
It worked!
However, it only shows on the profile of the user. I want the color to show in the activity feed and everywhere you see their avatar on the website. Is that possible? How do I achieve this?Thanks!
Thank you @prashantvatsh
It still is not working. Could these files possibly be in the wrong folders?