Skip to:
Content
Pages
Categories
Search
Top
Bottom

css independence in buddypress

  • @denorm

    Participant

    Hi, (My second post in an hour, apologies if that’s too much!)

    I’m a developer just starting out on my first BuddyPress project. Really excited about it- after researching for a few weeks and trying out other solutions I determined BuddyPress was definitely the right way to go for creating a social network.

    I’m currently trying to adapt the bp-legacy templates to a Bootstrap-based theme. I’d really like to rely purely on the bootstrap css and not load any buddypress css. But some of the buddypress functions include css class names. I have been converting them to accept arguments but I really don’t want to update the buddypress core files.

    For example:

    from: function bp_get_options_nav() {…}
    to: function bp_get_options_nav($css_selected_class = “current selected”) {…}

    from: function bp_get_displayed_user_nav() {…}
    to: function bp_get_displayed_user_nav($css_selected_class = “current selected”) {…}

    It could be taken farther to include the html tags to use, but for now I just use the standard unordered lists.

    Is there a better way other than modifying the buddypress core files? Or should I just give in and make CSS classes to fit buddypress?

    (WordPress 3.5.1, BuddyPress 1.7.2)

Viewing 2 replies - 1 through 2 (of 2 total)
  • @hnla

    Participant

    Don’t ever ever modify core files period! Not really sure why you are having to do this but don’t mess around with BP elements or their classes as many are required as a lot of the JS/Ajax functionality hooks to them.

    If you have to use bootstrap that’s your choice but bootstrap doesn’t replace the necessity for BP styles -overload the BP styles if required to edit / modify them.

    I assume you have a set up a child theme to setup your theme in and letting theme compatibility take over the template handling for BP pages.

    @denorm

    Participant

    Hi Hugo, thanks for the response! Yes, I agree and I feel uncomfortable editing the buddypress core files.

    In my opinion, ideally buddypress core functions would not include any references to CSS class names, as that’s purely presentation and should be located separately in the theme/template files. I can understand id tags being required for functionality, but it seems there must be some way to move the css class references out of the main code.

    It just seems weird to define a new css class even though bootstrap already has an “active” definition similar to buddypress’ “current selected”?

    But like I said, I’m new to BuddyPress. And as a back-end programmer I really dislike messing around with css. I’ll follow your advice and add buddypress-specific css classes..

    Thanks for the advice!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘css independence in buddypress’ is closed to new replies.
Skip to toolbar