Skip to:
Content
Pages
Categories
Search
Top
Bottom

Buddypress css styles button but I want to use bootstrap classes.


  • liammitchell
    Participant

    @liammitchell

    I am adding my own profile tabs but the buddypress css is applied for buttons instead of bootstrap css from my theme.

    How should I go about preventing buddypress from styling buttons? Can I change the loading order of Bootstrap vs Buddypress css?

    css
    .buddypress .buddypress-wrap .activity-read-more a, .buddypress .buddypress-wrap .comment-reply-link, .buddypress .buddypress-wrap .generic-button a, .buddypress .buddypress-wrap a.bp-title-button, .buddypress .buddypress-wrap a.button, .buddypress .buddypress-wrap button, .buddypress .buddypress-wrap input[type=button], .buddypress .buddypress-wrap input[type=reset], .buddypress .buddypress-wrap input[type=submit], .buddypress .buddypress-wrap ul.button-nav:not(.button-tabs) li a {
    

    Buddypress Version: 4.3.0
    Buddypress Theme: Nouveau
    WP Theme: Child of IT Company theme which includes Bootstrap.

    Example HTML button with bootstrap class.

    html
    <button class="btn btn-primary" type="button" id="btnMyButton">My Button</button>
    

    Kind regards,
    Liam

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

  • liammitchell
    Participant

    @liammitchell

    When using wp_enqueue_scripts I should set a higher priority number.
    But need to remove from parent themes css enqueue first, maybe something like this will work.

    
    /**
     * Proper way to enqueue scripts and styles
     */
    function it_company_child_theme_scripts() {
      wp_dequeue_style('bootstrap'); // from parent theme
      wp_deregister_style('bootstrap');
      wp_enqueue_style('bootstrap', get_template_directory_uri().'/css/bootstrap.css', 10);
    }
    add_action( 'wp_enqueue_scripts', 'it_company_child_theme_scripts' );
    

    Venutius
    Moderator

    @venutius

    ONe option is to overload the buddypress css by creating a file in themes/buddypress/css/buddypress.min.css you could then choose not to add any bp css styling to those elements.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar