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.