Hiding a div on buddypress pages

I would like to hide a div on specific pages; mainly the buddypress pages; members and it's children (profile etc), activity and groups.

The div in question is 'featured-box' http://audioknowledge.net/ (the big searchbar).

Could you provide me with a else if snippet I can paste somewhere in my child theme? I'm a n00b so sorry if none of this makes sense.

  • Adam Czajczyk
    • Support Gorilla

    Hey @durk kooistra,

    I hope you're having a great day!

    To remove this searchbar you may simply hide it with CSS, which I'll get back to later.
    First of all please go to your dashboard's

    "Appearance" -> "Customize" page

    and search for a tab called "Featured box" or "Widgets" and find out if there's an option to simply switch this box with a click. If there's no, take a look at

    "Appearance" -> "Widgets" page

    and look for an area called "Featured box" or similar. If it's there you'll find a "Search" widget there. Simply drag it out of that area.

    If it doesn't work for you, please install "Simple Custom CSS" plugin. It's free and you can find it here:

    https://wordpress.org/plugins/simple-custom-css/

    There'll be a single text box in plugin's settings page. Put this code inside and save:

    #featured-box {
    display:none;
    }

    I hope that helps.

    Cheers,
    Adam

  • durk kooistra
    • WPMU DEV Initiate

    Hey Adam,

    Thanks for the quick reply, much appreciated!

    I got this far, however I would only like to hide it on buddypress related pages as mentioned in the op.

    buddypress pages; members and it's children (profile etc), activity and groups.

    Perhaps this can be done in a css plugin too?

  • durk kooistra
    • WPMU DEV Initiate

    Ok, I figured it out, I think. Right now I am hiding the div on a per page basis.

    body.page-id-5 #featured-box {
    display: none;
    }
    body.page-id-0 #featured-box {
    display: none;
    }

    So fellow n00bs FFR:
    Check on what pages you want to hide your div (look for the ID in firebug or chrome dev plugin) and add it like the example above.

  • Adam Czajczyk
    • Support Gorilla

    Hello @durk kooistra,

    I hope you're well today and I'm sorry for the delay here!

    I'm glad to know that you've got a solution. it seems like my advice was quite correct although lacked some particular details :wink: I think that your example code will help other members of our community so thank you for this.

    In case of any other questions, don't hesitate to ask. I'll be happy to assist.

    Have a great day,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.