Removing replacing search at top of Scholar theme

I am not happy with the search results I get from the search box included in the Scholar theme. I like the search widget much better that allows users to search by member, forum, group or blog. I imagine that others might want to use other search features instead of the default one.
I know how to remove it manually but it would be great if this could be part of the theme options. People could toggle it on or off and it would make theme upgrading so much easier.

  • Tammie

    @worldwidewhirlwind: You will want to go into sidebar-home.php at line 3 - 11 remove:

    <div class="h4-background"><h4> <?php _e( 'Search our community', 'bp_scholar' ) ?></h4></div>
    <div class="widget-wrapper">
    <form action="<?php echo bp_search_form_action() ?>" method="post" id="search-form">
    <input type="text" id="search-terms" name="search-terms" onfocus="if (this.value == '<?php _e( 'Start Searching...' ) ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e( 'Start Searching...' ) ?>';}" size="25"/>
    <?php echo bp_search_form_type_select() ?>
     <input type="submit" name="search-submit" id="search-submit2" value="<?php _e( 'Search', 'buddypress' ) ?>" class="search-dark"/>
    <?php wp_nonce_field( 'bp_search_form' ) ?>
    </form>
    </div>

    In our manual we list all the sidebars and what they relate to that should help in your diagnosis - it's the PDF that comes with this theme.

  • Tammie

    @OmniTechnical: You really would be best to start a new thread as this was for a different theme however if you wish to remove the search and login form from Corporate you will want to edit header.php and remove the following (lines 262 - 327):

    <?php do_action( 'bp_before_search_login_bar' ) ?>

    <?php if($bp_existed == 'true') { //check if bp existed ?>

    <?php if( !bp_is_register_page() ) { ?>

    <div id="searchbox">

    <form action="<?php echo bp_search_form_action() ?>" method="post" id="search-form">
    <input type="text" id="search-terms" name="search-terms" value="" />
    <?php echo bp_search_form_type_select() ?>
    <input type="submit" name="search-submit" id="search-submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
    <?php wp_nonce_field( 'bp_search_form' ) ?>
    </form>
    <?php do_action( 'bp_search_login_bar' ) ?>

    <div id="fc_wrap">
    <?php if ( !is_user_logged_in() ) : ?>

    <?php $check_active_signup = get_site_option( 'registration' ); if( $check_active_signup == 'none' ) { //if signup allowed ?>
    <?php } else { ?>

    <?php do_action( 'bp_before_sidebar_login_form' ) ?>

    <form name="login-form" id="login-form" action="<?php echo site_url( 'wp-login.php' ) ?>" method="post">
    <input type="text" name="log" id="user_login" value="<?php _e( 'Username', 'bp-corp') ?>" onfocus="if (this.value == '<?php _e( 'Username', 'bp-corp') ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e( 'Username', 'bp-corp') ?>';}" />
    <input type="password" name="pwd" id="user_pass" class="input" value="" />
    <input type="checkbox" name="rememberme" id="rememberme" value="forever" title="<?php _e( 'Remember Me', 'bp-corp' ) ?>" />
    <input type="submit" name="wp-submit" id="wp-submit" value="<?php _e( 'Log In', 'bp-corp') ?>"/>
    <?php if ( bp_get_signup_allowed() ) : ?>
    <input type="button" name="signup-submit" id="signup-submit" value="<?php _e( 'Sign Up', 'bp-corp') ?>" onclick="location.href='<?php echo bp_signup_page() ?>'" />
    <?php endif; ?>
    <input type="hidden" name="testcookie" value="1" />
    <?php do_action( 'bp_login_bar_logged_out' ) ?>
    </form>

    <?php do_action( 'bp_after_sidebar_login_form' ) ?>

    <?php } ?>

    <?php else : ?>

    <div id="logout-link">
    <?php bp_loggedin_user_avatar( 'width=20&height=20' ) ?>   <?php bp_loggedinuser_link() ?> / <?php bp_log_out_link() ?>
    <?php do_action( 'bp_login_bar_logged_in' ) ?>
    </div>

    <?php endif; ?>

    </div>
    </div>
    <?php } //dont show in reg page ?>

    <?php } else { ?>

    <div id="searchbox">
    <?php load_template (TEMPLATEPATH . '/profile.php'); ?>
    </div>

    <?php } ?>

    <?php do_action( 'bp_after_search_login_bar' ) ?>

    However, in doing this you may effect some settings.

  • Tammie

    @David Payne: I can't really comment on the google code you'd use but you need to go to includes/searchform.php and put it in there.

    <?php do_action( 'bp_before_blog_search_form' ) ?>

    <form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
    <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="<?php _e( 'Search', 'buddypress' ) ?>" />

    <?php do_action( 'bp_blog_search_form' ) ?>
    </form>

    <?php do_action( 'bp_after_blog_search_form' ) ?>

    becomes

    <?php do_action( 'bp_before_blog_search_form' ) ?>

    Your google search code here

    <?php do_action( 'bp_after_blog_search_form' ) ?>

    You may have to do some CSS changes and can do this in your child by creating that file and remember to keep the folder structure so create an includes folder in your child.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.