Skip to:
Content
Pages
Categories
Search
Top
Bottom

the_post_thumbnail & the activity stream


  • jivany
    Participant

    @jivany

    Can someone point me to where I can make the activity stream show a new blog posts “thumbnail” picture? I seem to be looking in all the wrong places tonight.

Viewing 8 replies - 1 through 8 (of 8 total)

  • r-a-y
    Keymaster

    @r-a-y

    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”.


    jivany
    Participant

    @jivany

    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.


    Fdot
    Participant

    @fdot

    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 ?


    Roger Coathup
    Participant

    @rogercoathup

    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)


    Roger Coathup
    Participant

    @rogercoathup

    @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?


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    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.


    Bowe
    Participant

    @bowromir

    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.


    Roger Coathup
    Participant

    @rogercoathup

    @bowromir – I give a solution that uses the post thumbnail at the bottom of this thread: https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/replace-activity-stream-blog-excerpt-with-the_excerpt

    Cheers, Roger

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘the_post_thumbnail & the activity stream’ is closed to new replies.
Skip to toolbar