Robert.S (@roberts-1)

Forum Replies Created

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

  • Robert.S
    Participant

    @roberts-1

    Thanks so much Robkk.

    I’ll take a look at those files, and see if any plugins might do the trick.

    I am using some custom code I found *somewhere* (!! maybe here haha??) to include Forum results in general WordPress Search results, which works well enough, but of course this is from a site-search, not the BBPress search function.

    Here it is in case anyone else stumbles across this thread and wants to extend WordPress searches to include Forum results (without adding a plugin):

    /**
     * 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' );

    Robert.S
    Participant

    @roberts-1

    Ooopsy. Don’t know what went wrong with those image urls. Here they are again:

    Avada BBPress Search Results: https://www.dropbox.com/s/04ndkdsjlpa5k8j/avada-forum-search.jpg?dl=0

    ExpressionEngine old forum Search Results: https://www.dropbox.com/s/u31awcckz4261oi/Expression-Engine-forum-search.jpg?dl=0


    Robert.S
    Participant

    @roberts-1

    Thanks a bunch for the code, both @robkk and @undergroundnetwork!

    I’m running Avada theme, with latest WordPress 4.2.1 and BBPress 2.5.7 and this works perfectly.

    Seems like this *should* be an option in WordPress when BBPress is installed: “Check the box to include Forum Topics and Replies in the sitewide search”. Would be a helpful addition.

    Luckily we have this resource, so thanks again for the code snippets.

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