Hi Carsten,
Thank you for the question.Are you using BP Legacy or BP Nouveau template pack?
Regards
BrajeshHi Carsten,
You can use the following code to remove the last activity meta from profile.// remove last activity. add_filter( 'bp_nouveau_get_member_meta', function ( $meta, $member, $is_loop ) { if ( $is_loop ) { return $meta; } unset ( $meta['last_activity'] ); return $meta; }, 10, 3 );
After that, you can print the meta anywhere you need. Since you mentione dthe hook ‘generate_after_page_title’, is that an action of filter hook?
Regards
BrajeshHi Brajesh, thanks, ‘generate_after_page_title’ appears to be an action hook
Regards
CarstenHi Carsten,
Thank you.Please add the following too
add_action( 'generate_after_page_title', function () { if ( ! bp_is_user() ) { return; } printf( '<span class="activity">%s</span>', esc_html( bp_get_last_activity( bp_displayed_user_id() ) ) ); } );
That should generate the content after title.
Regards
BrajeshHi Brajesh, thank you very much for your help with this code snippet, which makes the profile design possibilities much better.
But I have an issue with styling, I’m trying to add a div class for styling like this, but it breaks my site, no matter how I wrap it?
<div class=”activity”>
</div>Regards
CarstenHi Carsten,
please avoid using class ‘activity’ on div. BuddyPress will treat it as activity list container and will apply some undesired css.
You should change the class if you want to use div.
Regards
Brajesh
You must be logged in to reply to this topic.