Jul 19, 2023 8:26 am
My sitemap is showing 0 posts on my forum, how do i fix this?
13 Replies
Jul 19, 2023 10:21 am
The sitemap is created by All in One seo (it shouldn't) and not from wpForo. Disable all in on seo and check again.
Jul 19, 2023 10:23 am
Also W3TC db caching may create issues. Why use such a heavy and unstable plugin as W3TC?
Jul 19, 2023 12:10 pm
Let me try again.
Use this plugin
https://wordpress.org/plugins/code-snippets/
to add this small code:
add_filter('wpforo_content_after', function( $content ){
return preg_replace_callback(
'#<a[^><]*\sclass=[\'\"](?:[^\'\"]*\s)?wpforo-default-attachment(?:\s[^\'\"]*)?[\'\"][^><]*\shref=[\'\"]([^\"\']+)[\'\"][^><]*>.*?</a>#isu',
function( $match ){
$html = $match[0];
$file = $match[1];
$pathinfo = pathinfo( $file );
if( wpforo_is_image($pathinfo['extension']) ) {
$html = sprintf(
'<a href="%1$s" target="_blank"><img class="wpforo-default-image-attachment" src="%1$s" alt="%2$s" title="%2$s"></a>',
esc_url($file),
esc_attr($pathinfo['basename'])
);
}
return $html;
},
$content
);
}, 11);
Jul 19, 2023 12:35 pm
It worked, thanks very much