Skip to:
Content
Pages
Categories
Search
Top
Bottom

BBPress search function doesnt return results goes to home page

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

  • JaneAkshar
    Participant

    @janeakshar

    website chinnockswharf.website


    JaneAkshar
    Participant

    @janeakshar

    any answers


    Robkk
    Moderator

    @robkk

    Okay I tested the bbPress forum search on my localhost setup with the latest bbPress, BuddyPress, and WordPress, and I have no issues.

    I am running a default setup, and I do not have the forums under a directory called “members area” though. If you run bbPress in the default setup without putting it under the “members area” directory would it work on your site if you searched “forum” for your only forum on your site?

    I am not entirely sure how you did the members area directory on your site in the first place, I am not entirely sure it is a sub directory in a multisite setup.


    JaneAkshar
    Participant

    @janeakshar

    I used the plugin wp-members and put the forums in the member area. I have been speaking to the author of that plugin who is brilliant with support and he had problems at the begining as well. So I have done loads more searching and it is known problem which BBPress do nothing about

    There is no solution out there BUT what you can do is change the main search function to include forums and that is what I have eventually done. I do think BBPress should provide a proper solution

    So you ditch the BBPress function, it does not work. And amend the normal search to include forums. I used this code snippet to help.

    /**
    * Include bbPress 'topic' custom post type in WordPress' search results */
    
    function ntwb_bbp_topic_cpt_search( $topic_search ) {
            $topic_search['exclude_from_search'] = false;
            return $topic_search;
    }
    add_filter( 'bbp_register_topic_post_type', 'ntwb_bbp_topic_cpt_search' );
    
    /**
    * Include bbPress 'forum' custom post type in WordPress' search results */
    
    function ntwb_bbp_forum_cpt_search( $forum_search ) {
            $forum_search['exclude_from_search'] = false;
            return $forum_search;
    }
    add_filter( 'bbp_register_forum_post_type', 'ntwb_bbp_forum_cpt_search' );
    
    /**
    * Include bbPress 'reply' custom post type in WordPress' search results  */
    
    function ntwb_bbp_reply_cpt_search( $reply_search ) {
            $reply_search['exclude_from_search'] = false;
            return $reply_search;
    }
    add_filter( 'bbp_register_reply_post_type', 'ntwb_bbp_reply_cpt_search' );

    Robkk
    Moderator

    @robkk

    I used the plugin wp-members

    Is it this plugin??

    https://wordpress.org/plugins/wp-members/

    I cannot seem to figure out how you did the members area thing with this plugin (if it is the correct plugin).

    So I have done loads more searching and it is known problem which BBPress do nothing about

    Well there might be related issues to search redirecting to the home page, some had issues with the search query having a url structure and query different than intended by default, and some had issues with search plugins on their site, and I think some I tried to contact personally to help them since they had a premium theme and it is hard to just figure it out on premium themes that might have some kind of fancy ajax search having conflicts with the default bbPress search for example. Your issue could be somewhat related to the url structure.

    Do you have any steps that maybe I can try to replicate to find the cause of this issue, like explain how you set everything up?

    So you ditch the BBPress function, it does not work. And amend the normal search to include forums.

    Yes this can be a workaround for some, but since you may have private members only content this solution may not be practical.

    Does the default bbPress search work fine on a fresh installation with just your theme and no other plugins like wp-members?

    If you haven’t already known if bbPress search works by default with just your theme and bbPress activated, consider created a localhost setup to test the default bbPress search to see if it works on a default fresh installation, then we can work backwards and try to find the cause of this issue that you are experiencing.

    https://codex.bbpress.org/getting-started/testing-your-bbpress-installation/creating-a-test-site/


    JaneAkshar
    Participant

    @janeakshar

    The author of wp-members (yes it was that plugin) suggested deactivating his plugin and then trying but it still did not work. so no it did not work with that theme Custom Community 2.0 with or without the members area.


    JaneAkshar
    Participant

    @janeakshar

    These are my plugins
    bbPress
    Category Posts Widget
    Contact Form 7
    Display Posts Shortcode
    iThemes Security
    jetpack by WordPress.com
    Really Simple CAPTCHA
    Wordfence Security
    WP Google Maps
    WP-Members
    Yoast SEO


    Robkk
    Moderator

    @robkk

    @janeakshar if you don’t mind, could you contact me through email and send me login details so I could see what could be causing this issue on your site.

    https://robkkdev.wordpress.com/contact/


    JaneAkshar
    Participant

    @janeakshar

    @robkk I have set you up as an admin and you should get an email to this address

    Truly appreciate your help.

    I am on Egyptian time so 3am here, hope you get the login ok


    Robkk
    Moderator

    @robkk

    @janeakshar

    Just fixed the search issue, it is because you had your forum search slug as “search forums”. The space between the two words outputs as something like this %% I think, and it causes a weird url and it just redirects to your homepage for some reason. You can change it to “search-forums” if you really want to change it, just don’t leave a space.

    You can delete the admin account you created for me for security purposes.

    3am is pretty late, like damn take a nap already ya night owl haha.


    JaneAkshar
    Participant

    @janeakshar

    lol it is so easy when you know how isnt it

    peace and love

    mega grateful

    PS I was in bed but had the phone on, then you get me all woken up


    Robkk
    Moderator

    @robkk

    Ehh just had a funny feeling it had to do something with the custom slugs in Settings > Forums, saw that you made edits there just confirmed it.

    No problem.


    JaneAkshar
    Participant

    @janeakshar

    @robkk

    silly thing but is there anyway to make the nil search result dialog a bit more formal

    currently it says “Oh bother! No search results were found here!”


    Robkk
    Moderator

    @robkk

    @janeakshar

    You have to create a child theme, and copy and edit the feedback-no-search.php template, and put that edited file in a folder called bbpress in that child theme.


    JaneAkshar
    Participant

    @janeakshar

    OK, thanks

    Back to bed


    jcermak
    Participant

    @jcermak

    Having the exact same issue. Checked my single forum slug for search and was only set to “search”. Changed it to “search-forums” and still just returns to my homepage whenever I click search.

    I appreciate you working out a resolution. Anyone else have this issue still even with no spaces in the search slug?


    Babblebey
    Participant

    @babblebey

    This should resolve the issue here for anybody who could have same problem

    [Resolved] BBPress forum search not working

    Settings that i made

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