Skip to:
Content
Pages
Categories
Search
Top
Bottom

Similar topics bbpress


  • DeepBlue
    Participant

    @deepblue5

    Hi

    Is there a way to show similar topics at the end of a topic ?

    i know it might be an issue for performance when a forum has a lot of topics

    An idea of the cost & requirements of doing this as a paid job ?

    Easier alternative : show the last 5 topics of the same forum : how to do this ?

    Thanks 🙂

Viewing 11 replies - 1 through 11 (of 11 total)

  • Robin W
    Moderator

    @robin-w

    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?


    DeepBlue
    Participant

    @deepblue5

    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)


    Robin W
    Moderator

    @robin-w

    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!


    DeepBlue
    Participant

    @deepblue5

    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


    Robin W
    Moderator

    @robin-w

    add_action( 'bbp_template_after_single_topic', 'rew_other_topics' );


    Robin W
    Moderator

    @robin-w

    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


    DeepBlue
    Participant

    @deepblue5

    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 !


    Robin W
    Moderator

    @robin-w

    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


    DeepBlue
    Participant

    @deepblue5

    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


    Robin W
    Moderator

    @robin-w

    sorry, works on my test site, so beyond free help contact me via

    Contact me


    DeepBlue
    Participant

    @deepblue5

    Hi

    I have sent you an email 🙂

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.
Skip to toolbar