Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Activity Page Photos Not Showing › Reply To: Activity Page Photos Not Showing
July 9, 2021 at 8:02 am
#33871
Keymaster
Thank you!
Well, in that case there is a custom code worth trying. I could not find much information about this on the buddypress API, so this may not work at all.
add_filter( 'asp_results', 'asp_fetch_image_from_activity', 10, 1 );
function asp_fetch_image_from_activity( $results ) {
foreach ($results as $k => &$r ) {
if ( $r->content_type == 'bp_activity') {
$activity = bp_activity_get_specific( array( 'activity_ids' => $r->id ) );
$activity = $activity['activities'][0];
$im = asp_get_image_from_content($activity->action);
if ( $im != '' ) {
$r->image = $im;
}
}
}
return $results;
}
Try adding this code to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.