Skip to:

Re: Adding title to activity stream in blog posts

Roger Coathup


@nirok, @jasperespejo

The activity content is written out by the function bp_activity_content_body() called from activity/entry.php in your bespoke BuddyPress theme.

You could try implementing your own version of bp_activity_content_body(), and changing your entry.php to call the new function. Or you could try implementing a filter on bp_get_activity_content_body. Either way you’ll want them to output the link to the blog and blog title. Have a look at these in bp-activity-templatetags.php.

I’m not sure quite how (you’ll have to dig in the activities_template structure), but you should be able to pull out the blog_id and query for blog link and title as well. Any core gurus got a pointer or two here?

To make it a bit more efficient, and restrict it just to blog post activity updates, you can check whether the activity is a blog post in your loop in entry.php with:

If (bp_get_activity_type() == ‘new_blog_post’) :

Good luck… let me know how you get on.

Skip to toolbar