最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

templates - How to override BuddyPress 3.0 bp-nouveau theme files?

matteradmin11PV0评论

The Buddypress 3.0 uses bp-nouveau template as default. How can I override the CSS and other template files in WordPress theme? Earlier it would be done by copying bp-legacy folder into the WordPress theme folder and renaming it to buddypress but it does not seem to work for the bp-nouveau theme. Even if I copy it to the theme folder, BuddyPress continues to use the files from the buddypress pluginlocation.

I could not find any information about Buddypress 3.0 template structure in the codex.

The Buddypress 3.0 uses bp-nouveau template as default. How can I override the CSS and other template files in WordPress theme? Earlier it would be done by copying bp-legacy folder into the WordPress theme folder and renaming it to buddypress but it does not seem to work for the bp-nouveau theme. Even if I copy it to the theme folder, BuddyPress continues to use the files from the buddypress pluginlocation.

I could not find any information about Buddypress 3.0 template structure in the codex.

Share Improve this question asked Jun 4, 2018 at 12:54 RaiRai 411 silver badge3 bronze badges 1
  • If you are having problems overriding parent templates, make sure the file permissions are correct. If the file cannot be read by the server process, then WordPress will silently fail to find the template file in the child theme. – Flimm Commented Dec 3, 2024 at 10:07
Add a comment  | 

2 Answers 2

Reset to default 5

I know it is an old question but im pasting this here in case someone is looking for the same answer.

Overloading Template Compatibility theme files Template compatibility also runs a check to see if two directories or folders exist in a theme:

'buddypress'
'community'

If either of these two folders exist in your theme and they contain BP template files then those files will be used in preference to the bp plugins versions.

Therefore, you can modify any bp theme compatibility template by copying it over from:

/bp-templates/bp-legacy/buddypress/

To:

/my-theme/community/ or /my-theme/buddypress/

N.B. Inside the subfolder ‘community’ you must preserve the path structure/folders that exist in the BP original /buddypress/ folder so /activity/ must be created to hold index.php or any of the other activity templates.

Additionally to keep things neat & tidy you can keep your custom parent template file ‘community.php’ in these folders as well rather than your theme root.

You may override the css by adding a folder /css/* to your theme root if you then, either, copy buddypress.css from /bp-legacy/ or create a new file named buddypress.css this file will be used instead of the buddypress version. * As of BP 1.8 the paths for assets i.e styles and JS has been modified to look to your ‘buddypress’ or ‘community’ folders first, this means you will be able to locate your /css/ folder inside your buddypress one.

Source: https://codex.buddypress/themes/theme-compatibility-1-7/a-quick-look-at-1-7-theme-compatibility/

Inside your wordpress theme (hopefully a custom or child theme) create a "buddypress" folder.

Then you can override files from the /plugins/buddypress/bp-templates/[buddypress theme] folder. But you must keep the exact same folder structure. It works with bp-nouveau also, I just checked.

For example, if I was using a wordpress theme called "mytheme", and I wanted to override or add something to a single member's profile page, I would create mytheme/buddypress/members/single/home.php

Post a comment

comment list (0)

  1. No comments so far