Forum Replies Created
-
Hi Dan,
I’ve perhaps described the situation poorly: I’m actually referring to the link above activity-item comments which states ‘Show all X comments’. On click, it reveals all additional comments beyond the intial five. I’ve attached a quick screenshot to clarify.
https://www.dropbox.com/s/g8s26v9sw4lejc8/bp_comments.png?dl=0
From past posts, I’ve gathered that others have updated ‘global.js’ (as above) to increase/decrease this threshold, but I’ve had no success with this method.
Read this to learn what the 1, 3 does.
Thanks for this, that’s actually cleared up a bit of misinformation I’ve had in the past.
I’m now using the following snippet if anyone needs it in the future. It may not be perfect in terms of logic, but it seems to be working well.
//* Add Job Title to activity function job_title_activity_action( $action, $activity, $r) { $bp_job_title = bp_get_profile_field_data( 'field=Job Title&user_id=' . bp_get_activity_user_id()); $job_title = '</a> <span class="job-title">' . $bp_job_title . '</span>'; $action = str_replace( '</a>', $job_title, $action); return $action; } add_filter( 'bp_get_activity_action_pre_meta', 'job_title_activity_action', 1, 3 );
Thanks for your help @shanebp, I really appreciate it!
Cheers, Graeme
@shanebp Thanks for this – it’s exactly what I’m looking for. I’ve dropped in some quick text just to test the placement and it’s dropping the job title in between ‘Posted an update…’ and ‘3 days, 16 hours go’, visible here: https://www.dropbox.com/s/9hh9ty6db63ct34/Screen%20Shot%202016-02-22%20at%2009.35.04.png?dl=0
I’m using the following, and assumed that tweaking the
1, 3
will re-order the placement, but from my attempts it either stays in the same place, or removes the user’s display name.//* Add Job Title to activity function graeme_activity_action( $action, $activity, $r) { $action .= '<span class="job-title">' . ' | Web Developer' . '</span>'; // simple example return $action; } add_filter( 'bp_get_activity_action_pre_meta', 'graeme_activity_action', 1, 3 );
Do you know which configuration I need to place the job title immediately after the user’s display name? I assume there’s also a way to move the ‘Posted an update’ text afterwards, I’m just not sure which is best practice.