Limited Support
Our support team is currently on holiday from December 25, 2025 to January 7, 2026, and replies may be delayed during this period.
We appreciate your patience and understanding while our team is away. Thank you for being part of the wpForo community!
Merry Christmas and Happy Holidays! 🎄
Hi, I use wpForo with addon embeds. Can I somehow make the post uploaded a photo, it was displayed as a photo and not as a link, see the attached picture on link.
Thank you.
https://photos.app.goo.gl/oqwMhDpN3i2yhRvQ9
You can do that with the attachments addon
Also try this in your theme's functions:
add_filter('wpforo_content_after', 'wpforo_default_attachment_image_embed', 11);
function wpforo_default_attachment_image_embed( $content ){
if( preg_match_all('|<a class=\"wpforo\-default\-attachment\" href\=\"([^\"\']+)\"[^><]*>.+?<\/a>|is', $content, $data, PREG_SET_ORDER) ){
foreach($data as $array){
if(isset($array[1])){
$file = $array[1];
$e = strtolower(substr(strrchr($file, '.'), 1));
if( $e == 'jpg' || $e == 'jpeg' || $e == 'png' || $e == 'gif' ){
$filename = explode('/', $file); $filename = end($filename);
$html = '<a href="' . esc_url($file) . '" target="_blank"><img class="wpforo-default-image-attachment" src="' . esc_url($file) . '" alt="' . esc_attr($filename) . '" title="' . esc_attr($filename) . '" /></a>';
$content = str_replace($array[0], $html, $content);
}
}
}
}
return $content;
}
https://wpforo.com/community/how-to-and-troubleshooting-2/uploading-and-embedding-images/#post-5212
I have added that code snippet too, and it worked a treat for showing one image in a post. Thank you! However, if I go back to edit any post with an image displaying, then I save the edit, the photo then reverts back to being displayed as a link. Any ideas please? Many thanks.