The function you’re looking for is bp_activity_thumbnail_content_images() in bp-activity.php.
There’s a filter you can apply to that function – “bp_activity_thumbnail_content_images”.
Thanks r-a-y. I’m not sure that’s quite the filter I’m looking for. It seems to create a thumbnail from one of the images in the content.
I realize now that I just want to modify the activity stream excerpt that is displayed to insert the WP 2.9 the_post_thumbnail() call. Since the post thumbnail is not always guaranteed to be within the blog post content itself.
jivany did you find any solution ? I would like to do exactly the same thing but with no luck.
I have try to make some change into that function : “bp_activity_thumbnail_content_images” but nothing was working.
If I try to add the_post_thumbnail(), it is not displaying any thumbnails
Any idea ?
Giving this one a bump – as I want the feature!
The challenge: display the featured image (post_thumbnail) from the latest site blog posts
The solution that comes to mind is: an activity stream loop to extract the blog post activity; get the blog id and post id; switch to the blog; query based on the post id to get the post_thumbnail
However, the switch to blog route strikes me as quite inefficient.
Does anyone have a better solution to this? Oh, and of course, a perfect working infinitely flexible code snippet to share
Thanks, Roger
p.s. the function bp_activity_thumbnail_content_images is being passed the blog post content, so doesn’t have access to the feature image (post_thumbnail)
@johnjamesjacoby – What are you thoughts on changing: bp_blogs_record_activity( ) to make use of the featured image if one has been set for the post, rather than trawling the content and thumbnailing images?
Good idea. It would probably need to write the thumbnail to the activity stream directly (same as it does now) but would include a thumbnail if there is one.
I would like to to use this as well.. Since the post thumbnail is used more and more, it would be cool to include it in the activity stream entries.