Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 9 years ago

#2337 closed defect (bug) (fixed)

Blog post images on activity stream not linking...

Reported by: floris Owned by:
Milestone: 1.5 Priority: normal
Severity: Version:
Component: Core Keywords:
Cc:

Description

Noticed the images are not linked to the parent post properly.

Rather than using bp_activity_thumbnail_content_images(), I'm trying to add the following to entry.php to establish this. Perhaps it's a starting point, but am not sure how to get the post ID for the activity blog post.

Add something like this to entry.php?

if ( $attachments = get_posts( array(
'numberposts' => 1,
'orderby' => 'menu_order ID',
'post_mime_type' => 'image',
'post_parent' => somethingsomething,
'post_type' => 'attachment',
) ) ) {
foreach ( $attachments as $attachment ) {
$link = get_permalink( $attachment->post_parent );
$source = wp_get_attachment_image_src( $attachment->ID, 'thumbnail' );
echo '<a href="' . $link . '"><img src="' . $source[0] . '" /></a>';
}
}

Best,

F.

Change History (3)

#1 @floris
9 years ago

Additionally, gallery shortcodes are being stripped completely. Would be great to find a way to include all galleries, first images or video from a blog post within the activity stream...

#2 @boonebgorges
9 years ago

Right now, blog post activity items contain only the first image from the blog post, in thumbnail form. Allowing through things like gallery stuff would make it pretty hard to be consistent about the way that activity items are styled. You are welcome to provide a patch for how that might work.

#3 @boonebgorges
9 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3519]) Links blog activity item thumbnails to the original post. Fixes #2337

Note: See TracTickets for help on using tickets.