Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide Search Bar from Header in Default BuddyPress theme

  • Well, it seems it’s just not my morning! What I thought would be a simple CSS move to display: none the search bar from the header of the default BuddyPress theme has turned into a challenge.

    Going into the css inside of the bp-default theme and messing with the #search-bar selector doesn’t do anything.

    What is the best/correct way to remove this from the header of the default BuddyPress theme?

    Thanks again for any pointers!

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

  • @mercime
    Keymaster

    @mercime

    Copy over header.php from bp-default theme to your child theme folder and delete lines 29 thru 39

    If you still want to go the CSS route, use `#header #search-form { display: none; }`

    Thanks Mercime! Very helpful!

    Well, I spoke to soon. This is my first experience with Child Themes, but I referenced this: https://codex.buddypress.org/theme-development/building-a-buddypress-child-theme/

    Seems like it couldn’t be simpler… I created a new director in wp-content/themes, added the required comments to the style.css file, plus the new css mod to hide the search form.

    When I “preview” the child theme in WP, it looks good as it should, search form gone, all other styles and settings in tact.

    But when I activate it, the entire theme goes back to the default BP Default, with the exception of the CSS change I made.

    When using a child theme, do I need to essentially “re-configure” all of my theme settings, or is something simply not working here? Hmm… maybe this needs a new post.

    Edit: New post for this topic: https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/child-theme-not-working/

    A child theme uses as it’s core the parent theme, it references any template pages you copy over from parent theme to child theme. The child theme files are used in preference to the same named file in parent theme likewise any functions files are read in order of child theme first then parent theme. All you need for a child theme to work is the style.css file with appropriate header block.

    I would follow mercims advise to copy over header.php and simply remove the physical markup or enclose it in php comments, display: none simply hides the visual display but doesn’t remove markup so technically it’s still there.

    Thanks Hugo… I tried that as well, and I am happy to go that route.

    However, I am having the same problem… when previewing the child theme, looks fine. Activating it kills all styles and settings EXCEPT for those made in the child theme.

    I am perhaps fundamentally misunderstanding about how child themes work… I thought they would use everything of the parent UNLESS, something new (template, style) was provided?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hide Search Bar from Header in Default BuddyPress theme’ is closed to new replies.
Skip to toolbar