Is there a way to show similar topics at the end of a topic ?
where – after the reply forum or before?
similar topics
The issue here would be to define how similar topics are identified?
hi
After the reply topic
To identify similar topics i know it is not easy, it needs to check for main words of the topic title (and ignore the non useful words like it, he, she, is, are etc)
but latest 5 if you have style pack installed would be
add_action( 'bbp_template_after_replies_loop', 'rew_other_topics' );
function rew_other_topics () {
$topic_id = bbp_get_topic_id() ;
$forum_id = bbp_get_topic_forum_id($topic_id) ;
echo do_shortcode("[bsp-display-topic-index show='5' forum =".$forum_id." template = 'list']") ;
}
though this would show the topic again if it were in the latest 5!
Great it works thank you but it shows before the reply forum, can it show after ? (as you asked above)
Also, is it better in performance that i add this directly on bbp theme file, rather than in functions.php ?
thanks
add_action( 'bbp_template_after_single_topic', 'rew_other_topics' );
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
Thank you it works !
but there is a problem : last topics show well on the first page of a topic
but when going to topic/page/2 the last topics dont show anymore, any idea why ?
Thanks !
works fine on my test site
it could be a theme or plugin issue
Themes
As a test switch to a default theme such as twentytwenty, and see if this fixes.
Plugins
If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.
If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users
Health Check & Troubleshooting
Then come back
Hi
I changed theme : twenty twenty, oceanwp, astra… same problem
also i disabled plugin (i have only 5) same problem
topic-url > last topics of forum are showing
topic-url/page/2 > last topics of forum are not showing anymore
thanks
sorry, works on my test site, so beyond free help contact me via
Contact me
Hi
I have sent you an email 🙂