Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to remove the search/login bar

  • Avatar of Reprocessor
    reprocessor
    Participant

    @reprocessor

    Hi Guys,

    I need to remove the search/login bar from my site but have no idea how to do this. It’s just the form elements that need taking out, the height of the container is ok as it makes a nice page break. Basically i’ve seen the widgets that’ll make this feature redundant (for me anyhow) and would really like to be able to take it off.

    As always, your help is appreciated.

    Phil :)

Viewing 10 replies - 1 through 10 (of 10 total)
  • Avatar of Reprocessor
    reprocessor
    Participant

    @reprocessor

    oh, the site is http://gigbuddy.org btw :)

    If I can comment it out that would be useful also, Might need it in the future ;)

    Phil

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    You can disable the admin bar completely by putting this in your bp-custom.php:

    function my_remove_adminbar(){
    remove_action( 'wp_footer', 'bp_core_admin_bar', 8 );
    remove_action( 'wp_head', 'bp_core_admin_bar_css', 1 );

    remove_action( 'admin_footer', 'bp_core_admin_bar' );
    remove_action( 'admin_menu', 'bp_core_add_admin_css' );
    }
    add_action( 'bp_home_theme_functions', 'my_remove_adminbar');
    add_action( 'bp_member_theme_functions' , 'my_remove_adminbar');

    If you want to leave the gap that the css reserves for the bar then don’t put in the remove_action()’s for the css. You can disable this by commenting out the two lines: add_action(‘bp_home_theme_functions’…) and add_action(‘bp_member_theme_functions’…).

    You can selectively disable/enable it for the home theme or the member theme by choosing to disable/enable it with the above technique also.

    The member and home theme’s functions.php file triggers those two functions as the last thing that happens in both areas. The hook is designed to allow just such a thing. I’m so glad that Andy is ‘hook happy’. :)

    Avatar of Reprocessor
    reprocessor
    Participant

    @reprocessor

    Burt, you are a god! Thanks a million :)

    Will test it out shortly.

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    np Phil. I’m building up a little database of these kind of things and stuffing them into my new dev group here: http://buddypress.org/groups/code-snippets-solution-library

    Soon as Andy gets the group forums up and running.

    Avatar of Reprocessor
    reprocessor
    Participant

    @reprocessor

    Stupid question #1 – where is bp-custom.php? is it in there or do I have to create it? If I have to create it where do I put it?

    Cheers,

    Phil

    Avatar of Reprocessor
    reprocessor
    Participant

    @reprocessor

    I’ve just realised, are we talking about the same thing here? you mentioned the ‘admin’ bar (grey bar that comes up when you login), that’s a feature I want to keep – it’s the search/login bar I need to disable.

    Avatar of Andy Peatling
    Andy Peatling
    Keymaster

    @apeatling

    You can just remove the search login bar from the template – Just remove:

    <div id="search-login-bar">
    <?php bp_search_form() ?>
    <?php bp_login_bar() ?>

    <div class="clear"></div>
    </div>

    From header.php of the home and member themes if you are using both.

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    Well, thanks Andy. I guess it helps to actually read the post first. Remind me not to go into the forums before I’ve had a cup of coffee. I see the word ‘bar’ and read admin bar. Never mind Phil. Cancel all that. Do what Andy says.

    Avatar of Reprocessor
    reprocessor
    Participant

    @reprocessor

    Thanks Andy :)

    Avatar of Gpo1
    gpo1
    Participant

    @gpo1

    Good tip !

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

You must be logged in to reply to this topic.