This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Tagged: 

bbpress forum search doesn't work

  • Creator
    Topic
  • #14223
    mlerota
    Member

    I have bbpress forum and search doesn’t work. If I switch to theme that comes with wordpress, search finds the words.
    My forum is here: http://www.ap-linux.com/forums/
    I have searched on internet for this problem, and other people have this problem too but on other themes…

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #14227
    Jason Bobich
    Keymaster

    Hi,

    The reason for this is because the theme uses a file called content-search.php to display when there are no search results found. The problem though is that bbPress has a template system setup where it uses a file with the same name, and allows you to override the plugin by putting the files in your theme. So, bbPress is taking this file of the theme with the same name and using it in place of its own.

    Anyway, with a little customization from your child theme, we can get things to work right. In your child theme, create a folder called “bbpress” and then inside make a new file called content-search.php. And in this file, just paste in from bbPress’s version of the file:

    <?php
    
    /**
     * Search Content Part
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    ?>
    
    <div id="bbpress-forums">
    
    	<?php bbp_breadcrumb(); ?>
    
    	<?php bbp_set_query_name( bbp_get_search_rewrite_id() ); ?>
    
    	<?php do_action( 'bbp_template_before_search' ); ?>
    
    	<?php if ( bbp_has_search_results() ) : ?>
    
    		 <?php bbp_get_template_part( 'pagination', 'search' ); ?>
    
    		 <?php bbp_get_template_part( 'loop',       'search' ); ?>
    
    		 <?php bbp_get_template_part( 'pagination', 'search' ); ?>
    
    	<?php elseif ( bbp_get_search_terms() ) : ?>
    
    		 <?php bbp_get_template_part( 'feedback',   'no-search' ); ?>
    
    	<?php else : ?>
    
    		<?php bbp_get_template_part( 'form', 'search' ); ?>
    
    	<?php endif; ?>
    
    	<?php do_action( 'bbp_template_after_search_results' ); ?>
    
    </div>
    #14231
    mlerota
    Member

    Thanks for a quick answer! The search is working. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The forum ‘Alyeska Responsive WordPress Theme’ is closed to new topics and replies.