tazogamer (@tazogamer)

Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • @tazogamer

    Participant

    Solution for: “Oh bother! No search results were found here!”

    Forum search does not work in 2.3.2

    @tazogamer

    Participant

    I am almost sure, you have problems inside your theme’s FUNCTIONS.PHP!
    find this phrase in your functions.php ( or maybe problem can be inside any other activated plugin):

    add_action(‘pre_get_posts’,……………

    there maybe set search query customizations, so if there is set/limited the post types, then bbPress post types maybe left out of scope. So, alter that code (i.e. change to something like this:

    add_action('pre_get_posts','my_search_filterr');
    function my_search_filterr($query) 
    {
    	if ($query->is_search())   //if ($query->is_main_query())
    	{
    		$arrs[]='post';
    		$arrs[]='page';
    		//and etc... 
    		
    		//Then bbPRESS types:
    		$arrs[]='topic';
    		$arrs[]='forum';
    		$arrs[]='reply';
    		$query->set('post_type', $arrs );
    		
    	}
    	return $query;
    }

    @tazogamer

    Participant

    Robin W! Thanks so much! Your answers led me to the solution:
    in functions.php , i have added(with add_filter) a modified “bbp_get_user_profile_url” function,which generates profile urls (original is in bbpress\includes\users\template.php):

    here is my code:

    remove_filter( 'bbp_get_user_profile_url', 'bbp_get_user_profile_url');
    add_filter('bbp_get_user_profile_url','my_replaced' , 10 ,4);	
    function my_replaced ($url, $user_id, $user_nicename = '' ){
    	global $wp_rewrite;
    	if ( empty( $user_id ) ) {return false;}
    	$early_profile_url = apply_filters( 'bbp_pre_get_user_profile_url', (int) $user_id );
    	if ( is_string( $early_profile_url ) ) {   return $early_profile_url; }
    	if ( $wp_rewrite->using_permalinks() ) { 	// if pretty permalinks
    		$url = $wp_rewrite->root . bbp_get_user_slug() . '/%' . bbp_get_user_rewrite_id() . '%';
    		if ( empty( $user_nicename ) ) { $user_nicename = bbp_get_user_nicename( $user_id );}
    
    		$url = str_replace( '%' . bbp_get_user_rewrite_id() . '%', $user_id, $url );
    		$url = home_url( user_trailingslashit( $url ) );
    
    	} 
    	else { 	// Unpretty permalinks
    		$url = add_query_arg( array( bbp_get_user_rewrite_id() => $user_id ), home_url( '/' ) );
    	}
    	//return apply_filters( 'Replaced_bbp_get_user_profile_url', $url, $user_id, $user_nicename );
    	return $url;
    }	

    @tazogamer

    Participant

    I WANT IT.
    HOW TO DO THAT?

    @tazogamer

    Participant

    I HAVE FOUND a solution to list (show) them –

    https://bbpress.org/forums/topic/displaying-sub-sub-forums/#post-141934

    In reply to: sub-sub forums

    @tazogamer

    Participant

    NEW VERSION of the solution can be found here –
    https://bbpress.org/forums/topic/displaying-sub-sub-forums/#post-141934

    @tazogamer

    Participant

    i am editing the code, and will post soon..

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