Notifications
Clear all

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! πŸŽ„

wpForo 1.x.x [Solved] Inserting photos doesn't work

5 Posts
2 Users
0 Reactions
524 Views
Posts: 3
Topic starter
(@peter100)
Active Member
Joined: 6 months ago

Hello,

I am trying to upload a photo (attach file). Unfortunately, only the link (Displayed as a paperclip with file name) to the photo is displayed.
How can the image be displayed directly in the forum?

I found Robert's code (for functions.php, but it does not work).


4 Replies
Posts: 3
Topic starter
(@peter100)
Active Member
Joined: 6 months ago

SOLVED!


My fault, found the mistake. Browser translate the code in german ... 🤣Β 

---

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' || $e === 'bmp' || $e === 'webp' ){
$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;
}

Reply
3 Replies
Sofy
 Sofy
Admin
(@sofy)
Joined: 8 years ago

Support Team
Posts: 5637

@peter100Β 

You can also, check out the wpForo Advanced AttachmentsΒ addon.Β 


Reply
(@peter100)
Joined: 6 months ago

Active Member
Posts: 3

@sofyΒ 
Hello Sofy,
Thank you, I have already purchased one add-on and may purchase another.
Are there any discounts available for renewals after one year? Otherwise, multiple add-ons can become quite expensive and are not cost-effective for most websites.
Otherwise, it is a great plugin.


Reply
Sofy
 Sofy
Admin
(@sofy)
Joined: 8 years ago

Support Team
Posts: 5637

@peter100Β 

Please read Tom's answer here: https://gvectors.com/forum/official-wpforo-addons/discount-for-renewal/#post-38201


Reply