Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to overwrite Nouveau template CSS in a child theme


  • ddesmond
    Participant

    @ddesmond

    Hello,

    I would like to clarify how to overwrite the BuddyPress Nouveau template css in a child theme.

    I have a fresh install of BuddyPress 11.1.0 and have created a new child theme structure. I have copied buddypress.css from:

    /plugins/buddypress/bp-templates/bp-nouveau/css

    to:

    /themes/my-child-theme/buddypress/css.

    I have made changes to this CSS file yet it is not loading the replacement stylesheet and the original unedited one is still being loaded.

    Am I doing this correctly? Can you please let me know the best approach for this? Everywhere I have looked suggests this method.

    Thanks so much!

Viewing 1 replies (of 1 total)

  • rsial
    Participant

    @rsial

    To overwrite the BuddyPress Nouveau template CSS in a child theme, you need to ensure that your child theme is properly enqueued and that the correct file path is used. Here’s the recommended approach:

    In your child theme folder, create a new directory called buddypress.

    Inside the buddypress directory, create a new directory called css.

    Copy the buddypress.css file from /plugins/buddypress/bp-templates/bp-nouveau/css into your child theme’s buddypress/css directory.

    In your child theme’s functions.php file, enqueue the modified CSS file. Add the following code:

    function enqueue_child_theme_styles() {
    wp_enqueue_style( ‘child-theme-buddypress’, get_stylesheet_directory_uri() . ‘/buddypress/css/buddypress.css’, array( ‘bp-nouveau-main’ ), ‘1.0’ );
    }
    add_action( ‘wp_enqueue_scripts’, ‘enqueue_child_theme_styles’, 999 );

    To overwrite the BuddyPress Nouveau template CSS in a child theme, you need to ensure that your child theme is properly enqueued and that the correct file path is used. Here’s the recommended approach:

    In your child theme folder, create a new directory called buddypress.

    Inside the buddypress directory, create a new directory called css.

    Copy the buddypress.css file from /plugins/buddypress/bp-templates/bp-nouveau/css into your child theme’s buddypress/css directory.

    In your child theme’s functions.php file, enqueue the modified CSS file. Add the following code:

    php
    Copy code
    function enqueue_child_theme_styles() {
    wp_enqueue_style( ‘child-theme-buddypress’, get_stylesheet_directory_uri() . ‘/buddypress/css/buddypress.css’, array( ‘bp-nouveau-main’ ), ‘1.0’ );
    }
    add_action( ‘wp_enqueue_scripts’, ‘enqueue_child_theme_styles’, 999 );
    Make sure to adjust the version number (‘1.0’) if you update your child theme’s CSS in the future.

    With these steps, the modified “buddypress.css” file from your child theme should be loaded and override the default styles from the BuddyPress Nouveau template.

    Remember to clear any caching plugins or server caches to ensure that the updated CSS is being served.

    If the changes still don’t take effect, it’s possible that another plugin or theme is conflicting with the child theme’s styles. In that case, you may need to investigate further and potentially use more specific CSS selectors or use a higher priority for the “wp_enqueue_style” function.

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