将 1.0 主题升级到 1.1

将 1.0 主题升级到 1.1

Codex Home → Legacy Docs → Archived Section: Theme Development → Upgrading a 1.0 Theme to 1.1
Upgrading a 1.0 Theme to 1.1

Archived file. Good up to BP 1.1

Starting at version 1.1, BuddyPress themes are simply WordPress themes with extra template files. The separation between a WordPress (old bphome) and BuddyPress (old bpmember) theme has been removed. All theme files are contained in the same theme and one theme design applies to the site as a whole.
This guide will help those people who have built custom themes for BuddyPress 1.0 transition to the new theme setup.
How you approach upgrading your theme really depends on your setup in BuddyPress 1.0. Please choose the section that best describes your situation and follow those instructions only.
These help guides make the assumption that you have copied the new 1.1 default themes (/plugins/buddypress/bp-themes/bp-sn-parent/ and /plugins/buddypress/bp-themes/bp-default/ into the /wp-content/themes/ directory.
「I』ve used the old default themes, but modified the layout/colors」

Duplicate /wp-content/themes/bp-default/ and give it a new unique name.
In your new duplicated default theme, inside the _inc/css folder create a file called 「custom.css」
Copy the custom CSS from both your old bphome and bpmember theme into this file and save the file.
Open up style.css in the root of your duplicated default theme.
Edit the 「Theme Name」 at the top of the style.css file and give it a unique name.
The last line of style.css is: /* @import url( _inc/css/custom.css ); */. Remove the starting /* and the ending */ on that line. Save the file.
Make sure you have backed up your 「/wp-content/bp-themes/」 directory, then delete it.
Log in as an admin and head to /wp-admin/ on your root blog.
Under 「Site Admin > Themes」, select 「yes」 next to the theme with the custom name you just entered into style.css
Under 「Appearance > Themes」 activate the theme for the root blog.
You should now be using the new one theme system with your design customizations.

「I』ve used a WordPress theme for my blog with the default BuddyPress member theme」
In BuddyPress 1.0 you could use a WordPress theme that was completely separate from your BuddyPress theme design. More often than not the BuddyPress theme would not get updated to match the WordPress theme design in use. This made the overall experience clunky.
With BuddyPress 1.1 you can integrate BuddyPress templates with your WordPress theme design. One thing to be aware of before taking this route is that WordPress themes only contain layout styles for blog pages – they are not built for the extra features BuddyPress provides. You will have to add custom CSS to your WordPress templates to handle the layout for the BuddyPress pages.

Duplicate your existing WordPress theme so you have a backup.
Open up the folder /wp-content/themes/bp-sn-parent/ and copy every folder and the following files 「optionsbar.php」, 「userbar.php」 and 「plugin-template.php」. Paste these folders and files into your active WordPress theme.

You will now need to make an edit:

Open up header.php and add the following lines (usually at the bottom inside of a content or container div, not inside the header div):
?123456<?php if ( !bp_is_blog_page() && !bp_is_directory() && !bp_is_register_page() && !bp_is_activation_page() ) : ?> <?php locate_template( array( 'userbar.php' ), true ) ?><?php locate_template( array( 'optionsbar.php' ), true ) ?> <?php endif; ?>
Save the header.php file.
Make sure you have backed up your 「/wp-content/bp-themes/」 directory (this is important for the last step), then delete it.
You should now be able to visit your site and BuddyPress URL』s and find that the BuddyPress pages will work with your general site design and header/footer. You will however find that BuddyPress pages are generally not presented correctly.
You can try including the components.css file from the BuddyPress parent theme to add layout styles to BuddyPress pages. Open up your WordPress theme』s style.css file. Add the following line below the comment header:@import url( ../bp-sn-parent/_inc/css/components.css )
You should now see basic layout styles for BuddyPress pages within your WordPress theme. You will likely still need to perform some cleanup to get things working completely seamlessly.

If you find that your WordPress theme is not being co-operative, you can install BuddyPress on a secondary blog giving you the option to theme BuddyPress differently than your root blog.
Full instructions to do this can be found here:
https://codex.buddypress.org/how-to-guides/install-buddypress-on-a-secondary-blog/
「I』ve built a completely custom WordPress theme and BuddyPress theme」
Not a problem, in your case you need to merge the two into one single WordPress theme.
It should be as simple as copying all of the templates from the BuddyPress theme and pasting them into the WordPress theme. Be sure to copy and paste over all of the CSS from the BuddyPress theme also.
Once you are done, backup your /wp-content/bp-themes/ directory and remove it. This will allow the new integrated theme to work.
p

更改内部配置设置

更改内部配置设置

Codex Home → Getting Started → Customizing → Changing Internal Configuration Settings
Changing Internal Configuration Settings

N.B: This article lists deprecated settings as well as current ones
 
There are many internal configuration settings that can be changed by adding a configuration definition line to your wp-content/plugins/bp-custom.php file or use a filter if available. Here』s a list of the current configurations that can be changed:
 
Avatar Configurations
Avatar specific settings can be changed:
define ( 'BP_AVATAR_THUMB_WIDTH', 50 );
define ( 'BP_AVATAR_THUMB_HEIGHT', 50 );
define ( 'BP_AVATAR_FULL_WIDTH', 150 );
define ( 'BP_AVATAR_FULL_HEIGHT', 150 );
define ( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 640 );
define ( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', $max_in_kb );
define ( 'BP_AVATAR_DEFAULT', $img_url );
define ( 'BP_AVATAR_DEFAULT_THUMB', $img_url );

 
Cover Image Configurations
To customize cover images please visit this link: https://codex.buddypress.org/themes/buddypress-cover-images/
 
Advanced Configurations
Put profiles in the root — http://example.org/username/
define ( 'BP_ENABLE_ROOT_PROFILES', true );
add_filter( 'bp_core_enable_root_profiles', '__return_true' );
N.B. If you use BP_ENABLE_ROOT_PROFILES there might be a situation where some user profiles get the same url as some posts or pages rendering either of them inaccessible. This might also be true of sub-sites if you』re running multisite with subdirectories. See ticket #1426 for more information.
Change the default tab opened when looking at a user』s profile (default is activity):
define( 'BP_DEFAULT_COMPONENT', 'profile' );
(Note: if you change the URL slug of xprofile, say, define ( 'BP_XPROFILE_SLUG', 'info' );, you would have to change it here accordingly,  define( 'BP_DEFAULT_COMPONENT', 'info' );  otherwise, link to the profile page would always jump to homepage.)
Change the default tab opened when looking at a group (default is home):
define( 'BP_GROUPS_DEFAULT_EXTENSION', 'members' );
Disable the admin bar / buddybar at the top of every screen:
define ( 'BP_DISABLE_ADMIN_BAR', true );
Swap the Buddybar for the WordPress toolbar: (default in buddypress 1.6)
define ( 'BP_USE_WP_ADMIN_BAR', true );
Disable the custom header functionality on the default BuddyPress theme:
define( 'BP_DTHEME_DISABLE_CUSTOM_HEADER', true );
Disable the 「You』ll need to activate a BuddyPress compatible theme…」 warning message in the WordPress administration screens:
define( 'BP_SILENCE_THEME_NOTICE', true );
Enable support for LDAP usernames that include dots:
define( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE', true );
Disable auto-joining of a group when non group member performs group activity:
defined( 'BP_DISABLE_AUTO_GROUP_JOIN', true );
Ignore all deprecated code (don』t load it):
define ( 'BP_IGNORE_DEPRECATED', true );
add_filter( 'bp_ignore_deprecated', '__return_true' );
 
Forum Configurations
Change the parent forum to use for all BuddyPress group forums:
define ( 'BP_FORUMS_PARENT_FORUM_ID', $forum_id );
 
Database Configurations
Set a custom user database table for BuddyPress (and WordPress to use):
define ( 'CUSTOM_USER_TABLE', $tablename );
Set a custom usermeta database table for BuddyPress (and WordPress to use):
define ( 'CUSTOM_USER_META_TABLE', $tablename );
 
Multisite Configurations
Allow BuddyPress to function on multiple blogs of a WPMU installation, not just on one root blog (More details about BP_ENABLE_MULTIBLOG):
define ( 'BP_ENABLE_MULTIBLOG', true );
add_filter( 'bp_is_multiblog_mode', '__return_true' );
Set which blog ID BuddyPress will run on:
define ( 'BP_ROOT_BLOG', $blog_id );
add_filter( 'bp_get_root_blog_id', 'filter_root_blog_id' ); // return blog ID integer
 
Deprecated Configurations
Change the URL slugs of BuddyPress components:
The references to slug Constants are deprecated, this section requires updating.
define ( 'BP_ACTIVITY_SLUG', 'streams' );
define ( 'BP_BLOGS_SLUG', 'journals' );
define ( 'BP_MEMBERS_SLUG', 'users' );
define ( 'BP_FRIENDS_SLUG', 'peeps' );
define ( 'BP_GROUPS_SLUG', 'gatherings' );
define ( 'BP_FORUMS_SLUG', 'discussions' );
define ( 'BP_MESSAGES_SLUG', 'notes' );
define ( 'BP_WIRE_SLUG', 'pinboard' );
define ( 'BP_XPROFILE_SLUG', 'info' );
define ( 'BP_REGISTER_SLUG', 'signup' );
define ( 'BP_ACTIVATION_SLUG', 'enable' );
define ( 'BP_SEARCH_SLUG', 'find' );
define ( 'BP_HOME_BLOG_SLUG', 'news' );

构建 BP 默认主题的子主题

构建 BP 默认主题的子主题

Codex Home → Legacy Docs → Archived Section: Theme Development → The BuddyPress Default Theme → Building a Child Theme of the BP Default Theme
Building a Child Theme of the BP Default Theme

Archived file. The BP Default theme will no longer be activated in new installations and will be retired in the near future. http://bpdevel.wordpress.com/2013/11/13/the-future-of-the-bp-default-theme/

This is an approach to child theming based on the BuddyPress Default theme. You may opt to choose a regular WordPress theme and take advantage of the BuddyPress Theme Compatibility introduced in version 1.7 which allows for nearly all WordPress themes to run BP templates within it』s theme and child themeing or customizing your BP templates by copying them to your theme/child theme easy to accomplish!
Should you then still prefer to create your own child theme for the BP Default theme, read on

The bp-default theme packaged with the BuddyPress plugin is a robust parent theme which includes network-centric template files in addition to special template files similar to what you would find in a regular WordPress theme.
You can easily create your own unique site design or theme based on the bp-default theme, thanks to the Parent-Child functionality available in WordPress that was implemented in the BuddyPress default theme. This step-by-step guide will help you build your own custom bp-default child theme.
Child Themes: What is the point? Why not just create a brand new theme?
Creating a bp-default child theme is the easiest and most future-proof way of building a BuddyPress theme. Aside from taking advantage of bp-default theme』s functionality, you can tweak it to suit your own needs. By extending the bp-default theme, you inherit all of the templates, JS, AJAX and if you wish, the CSS, all while preserving the core bp-default theme files.
When new versions of BuddyPress are released with an updated default theme, your theme will automatically be updated along with it! You can override any Parent theme template simply by either (1) copying it into your child theme and tweaking it or (2) creating a new, 「same-name」 template file in your Child theme directory. You can also add your own CSS, JS and AJAX features.
Stylesheet changes
As of BuddyPress 1.5, BuddyPress Default Theme (bp-default) uses a function, bp_dtheme_enqueue_styles, to enqueue its stylesheets as shown below.
if ( !function_exists( 'bp_dtheme_enqueue_styles' ) ) :
/**
* Enqueue theme CSS safely
*
* For maximum flexibility, BuddyPress Default's stylesheet is enqueued, using wp_enqueue_style().
* If you're building a child theme of bp-default, your stylesheet will also be enqueued,
* automatically, as dependent on bp-default's CSS. For this reason, bp-default child themes are
* not recommended to include bp-default's stylesheet using @import.
*
* If you would prefer to use @import, or would like to change the way in which stylesheets are
* enqueued, you can override bp_dtheme_enqueue_styles() in your theme's functions.php file.
*
* @see https://codex.wordpress.org/Function_Reference/wp_enqueue_style
* @see https://codex.buddypress.org/releases/1-5-developer-and-designer-information/
* @since 1.5
*/
function bp_dtheme_enqueue_styles() {

// Bump this when changes are made to bust cache
$version = '20130629';

// Register our main stylesheet
wp_register_style( 'bp-default-main', get_template_directory_uri() . '/_inc/css/default.css', array(), $version );

// If the current theme is a child of bp-default, enqueue its stylesheet
if ( is_child_theme() && 'bp-default' == get_template() ) {
wp_enqueue_style( get_stylesheet(), get_stylesheet_uri(), array( 'bp-default-main' ), $version );
}

// Enqueue the main stylesheet
wp_enqueue_style( 'bp-default-main' );

// Default CSS RTL
if ( is_rtl() )
wp_enqueue_style( 'bp-default-main-rtl', get_template_directory_uri() . '/_inc/css/default-rtl.css', array( 'bp-default-main' ), $version );

// Responsive layout
if ( current_theme_supports( 'bp-default-responsive' ) ) {
wp_enqueue_style( 'bp-default-responsive', get_template_directory_uri() . '/_inc/css/responsive.css', array( 'bp-default-main' ), $version );

if ( is_rtl() )
wp_enqueue_style( 'bp-default-responsive-rtl', get_template_directory_uri() . '/_inc/css/responsive-rtl.css', array( 'bp-default-responsive' ), $version );
}
}
add_action( 'wp_enqueue_scripts', 'bp_dtheme_enqueue_styles' );
endif;

What this means is that the function bp_dtheme_enqueue_styles() enqueues stylesheets in the following order:
a) bp-default theme』s main stylesheet, default.css
b) bp-default child theme』s stylesheet, style.css (if the activated theme is a bp-default child theme)
c) right-to-left CSS stylesheet, rtl.css, and
d) screen responsive stylesheet, responsive.css
Let』s Start Building!
The bp-default theme is located in the BuddyPress plugin folder at /wp-content/plugins/buddypress/bp-themes/ so it can be updated along with the plugin. WordPress knows where it is, even though your own child theme folder is in /wp-content/themes/.
A. Create a new theme folder
The first step is to create a new theme folder and give it a unique name. For this example, the theme is called 「BuddyPress Dusk」 and so we』ll name our folder bp-dusk. We』ll be uploading the bp-dusk child theme folder to wp-content/themes/
B. Create a style.css file
1. Create a new file and save as style.css in the bp-dusk child theme folder i.e. /bp-dusk/style.css. This will be your child theme』s stylesheet.
2. Open up the new style.css file and add the following code to the top of the file, replacing necessary details with your own.
/*
Theme Name: BuddyPress Dusk
Theme URI: http://example.org/themes/dusk/
Description: Dark theme for BuddyPress.
Version: 1.0
Author: John Doe
Author URI: http://example.org/
Template: bp-default
Tags: buddypress, two-column, grey, dark
*/

Two important items:

Template: bp-default – this tells WordPress that we want to use the BuddyPress default theme (bp-default) as the parent theme, and inherit all templates from it.
Tags: buddypress – this tells BuddyPress that you are using a BuddyPress-compatible theme so it won』t nag you in the admin area.

3. Save the style.css file.
4. At this point, upload bp-dusk folder to wp-content/themes/ in server. In the WordPress admin area > Appearance > Themes, you should see your new theme among the list of themes.
If you don』t see your child theme in the list of themes and your installation is Multisite, make sure you』ve enabled your BuddyPress Dusk theme in Network Admin > Themes.
5. Go ahead and activate your new child theme.
6. Check your home page of your site. You』ll notice that the design and layout of your child theme mirror those of the BuddyPress Default theme.
Congratulations! This means your new child theme is working correctly and inheriting all of the styles and template files.
(2) Inheriting CSS (or not!)
At this point you have an important decision to make:

you can inherit the default theme』s CSS and work from there, or
you can start writing your own CSS from scratch.

1. Inherit the default theme』s CSS and work from there
If you simply want to change the color scheme, and perhaps alter the layout a bit, it is highly recommended to inherit bp-default theme』s CSS. In BP 1.5+, you don』t have to do anything! Just start writing your new styles in your child theme』s style.css file and when you』re done, continue to section 3!
2. Start writing your own CSS from scratch.
If you plan to create a radically new theme design, you might want to start with a fresh slate. If you』re using BP 1.5+ and you decide you do not want to inherit the CSS, create a functions.php file in your child theme folder and add the following to your child theme』sfunctions.php:

This tells BuddyPress not to queue up the default styles. Now, you can start designing to your heart』s content!
Remember though, you still need to get your child theme』s style linked to your template files. You can do this by either:
a) Copying over the header.php file from the bp-default theme into your child theme』s folder, bp-dusk. Then add the link to your theme』s style.css file in header.php between bp_head and pingback_url like so:

<link rel="stylesheet" href="" type="text/css" media="screen" />
<link rel="pingback" href="" />

OR
b) enqueueing your child theme』s stylesheet in your child theme』s functions.php like so:
if ( !function_exists( 'bp_dtheme_enqueue_styles' ) ) :
function bp_dtheme_enqueue_styles() {

// You should bump this version when changes are made to bust cache
$version = '20130629';

// Register stylesheet of bp-dusk child theme
wp_register_style( 'bp-dusk', get_stylesheet_directory_uri() . '/style.css', array(), $version );

// Enqueue stylesheet of bp-dusk chid theme
wp_enqueue_style( 'bp-dusk' );
}
add_action( 'wp_enqueue_scripts', 'bp_dtheme_enqueue_styles' );
endif;

You can also enqueue bp-default theme』s rtl.css and responsive.css or create your own and add to the function above.
Continue on to section 3!
For BP 1.2 bp-default child themes:
If you』re still using BP 1.2.x and you want to inherit the bp-default theme』s CSS, will need to add the following lines to your 「style.css」 file (below the comment header):
/* Inherit the default theme styles */
@import url( ../../plugins/buddypress/bp-themes/bp-default/_inc/css/default.css );
/* Inherit the default theme adminbar styles */
@import url( ../../plugins/buddypress/bp-themes/bp-default/_inc/css/adminbar.css );

Once you』ve added these lines, try reloading your home page again. You』ll notice that the design has gone back to the design of the default theme. This is perfect, you can now start making design adjustments in your own theme by adding your own CSS styles below this line.
If you』ve decided that you do not want to inherit the CSS, then you can just start adding your own styles right below the header comment.
(3) Overriding BuddyPress』 Template Files
By default, your new child theme will inherit all the template files from the BuddyPress Default theme.
Most design and layout changes can be done in the CSS, but what if you wanted to change some of the HTML markup?
It』s now time to override some template files!
Let』s say I wanted to override the header.php template file.
The first step is to navigate to the BuddyPress plugin folder (usually /wp-content/plugins/buddypress/) and then to the BuddyPress Default theme folder — bp-themes/bp-default.
In this folder you should see the header.php file, copy this file and paste it directly into your child theme』s folder (the same place as your style.css file).
You can now make any edits to the HTML you wish and these will be reflected in your child theme. The header.php file in your child theme is essentially replacing the one from the BuddyPress Default theme.
You can do this with any template file from the BuddyPress Default theme. However, if you want to override a template file that is in a subfolder, you must also recreate the subfolder in your child theme.
(4) functions.php
There is one exception to the template override rule — functions.php.
If you create a blank functions.php file in your child theme, the parent theme (or in our case, the BuddyPress Default theme) functions.php will still be loaded.
This will allow you to inherit existing functions from BuddyPress Default, but you can also add your own customized code in here as well!
You must make sure you give your child theme functions a unique name, otherwise they will clash with the parent.

And that』s it! That is really all there is know about creating your brand-new child theme powered by the BuddyPress Default theme!
If you need help with anything listed in this tutorial, please post a question on our support forums:
https://buddypress.org/support/topics/

报告错误

报告错误

Codex Home → Participate and Contribute → Reporting Bugs
Reporting Bugs

Thanks to people like you, the BuddyPress community grows stronger each day. More and more people are testing or using BuddyPress for their websites. Naturally this means we are getting more bug reports, feature suggestions and other enhancement ideas than ever.
Please read this useful information on how to report bugs and features, and how you can help fix them.
Overview of Bug Reporting and Resolution

A user finds a bug that appears to be in the core of BuddyPress (not in a Theme or Plugin).
The user tries to make sure it is actually a bug; they can post on our forums if they are not sure.
If it is determined to be a bug, the user submits the bug report, called a ticket, to Trac (the BuddyPress bug tracking system).
A BuddyPress developer (who could be a volunteer like you) confirms that the bug does actually exist, and that it should be fixed, and marks it as such in the ticket. See Trac Keywords list (below).
A BuddyPress developer (which could be you) decides to fix the bug. The developer may choose to take responsibility for the bug by clicking on the Accept ticket option near the bottom of the ticket, though this is not required. Then the developer fixes the bug, creates one or more patch files, and uploads them to Trac.
Other BuddyPress developers may check the patch to see if it fixes the bug and doesn』t break anything else. They add comments and keywords to the ticket to indicate their results. See Trac Keywords list (below).
Andy Peatling (the only BuddyPress developer with authority to modify the official BuddyPress source code) will then commit the patch to the core code.  This means the fix will be included in the next release of BuddyPress.

Details of Bug Reporting and Resolution
The sections below add details to some of the steps outlined above.
Before You Report a Bug
Your bug may have already been reported. It』s very important to check to be sure it』s not already in the system before you submit it. If you are new to reporting bugs in BuddyPress or WordPress, it is also a good idea to discuss the issue with more experienced developers before reporting it. Please follow the steps below.

Search for your bug or feature request in Trac.

If your issue has already been reported, please do not report a duplicate bug. If you have further information to contribute, log in and add a note to the existing bug.
If your issue is similar, but not quite the same as another issue, you may decide whether to add a note to the similar issue, or report a new one. It can be difficult to decide whether your issue warrants a new submission, but in general if you just have more information to contribute to a current, open issue, simply add a note to that issue. If you have a different enough issue, or if you are experiencing a recurrence of an issue that was previously resolved, report a new bug.
If your issue was recently reported and then closed, and you do not agree with the resolution, you can also reopen the ticket and add a comment as to your reasoning.

To discuss a bug before reporting it in Trac (e.g. to figure out if it is really a bug in the core of BuddyPress and not in a Plugin or Theme), you can post a question on the BuddyPress Support Forum or discuss your issue on the #buddypress-dev IRC channel (irc.freenode.net).

Reporting a Bug
To report a bug, read Before You Report a Bug (above), and verify that you have a new bug that is appropriate to report.

Log into BuddyPress Trac using your forum username and password and select New Ticket in Trac to reach the bug reporting page.
Fill in the following fields on the new ticket page.

Short Summary
Make the summary short but informative and accurate, as this is the ticket title that will be displayed in search results.

Full Description
Fill in a full description of your bug or feature request. Include a description of the problem, steps someone else would have to take to reproduce the problem and maybe an example of the bug in action (i.e. a URL) or a screenshot. The better your description, the easier it is for a developer to find the bug.

Priority
Unless it is a critical bug, this is best left to the default as developers will usually rank the bug』s priority.

Assign to (optional)
You can also take responsibility for the bug yourself, by putting your username here.

Milestone
By what version this issue should be resolved, at the latest. Do not change this. This is an option that a BuddyPress developer will set.
Keywords
Keywords identify the areas the bug affects. An example might be 『wire』 for a bug involving the Wire component. Also, there are some standard keywords used to flag your bug』s status (see Trac Keywords below).
CC (optional)
Who bug information and updates should be sent to. If you want to be kept informed, enter your email address. You will then be notified by email any time a change is made to this report, or a note to the bug is added. Note: If you are the bug』s reporter, you will already get messages, so no need for CC.

Trac Keywords
There are a number of keywords with defined meaning used in Trac that are commonly used.

reporter-feedback
A response is needed from the reporter. Further investigation is unlikely without a response to the questions from someone experiencing the problem.
has-patch
A solution to the ticket has been attached, and it is ready for review and/or committing.
needs-testing
Someone needs to test the solution.
2nd-opinion
Another person is needed to express an opinion about the problem or the solution.
dev-feedback
A response is wanted from a developer (not commonly used).
tested
The patch has been tested. When adding this tag please comment with the patch filename that was tested, how the patch was tested, and which version of BuddyPress was used.
needs-patch
The ticket has been reviewed, found to be desirable to solve, and marked as especially needing a patch, or the submitted patch doesn』t work and needs to be redone.

Finding Bugs to Fix
Please view this forum post as it continues links to a number of Trac reports, allowing you to see which bugs are still awaiting a fix.

官方标志和字体

官方标志和字体

Codex Home → Official Logos and Typeface
Official Logos and Typeface

Need an official BuddyPress logo? Want to show your BuddyPress pride with a button on your blog? You』ve come to the right place. When you need the official BuddyPress logo for a web site or publication, please use one of the following. These are the real deal.
BuddyPress Logo Font
Fontin from the exljbris font library.
BuddyPress Logo (Vector PDF)

BuddyPress Logo (PNG)

BuddyPress Text Logo (PNG)

BuddyPress Disc Logo (PNG)

Large Icons (.psd)

Menu Icons (.psd)

Colors
Bright Red: #d84800
White: #FFFFFF
BuddyPress Wallpapers

BuddyPress Logo with Light Background

640×960 Smartphones
1024×768
1440×900
2048×1536 iPad
2560×1400
2880×1800 for Retina display

 
 
BuddyPress Logo with Blue Background

640×960 Smartphones
1024×768
1440×900
2048×1536 iPad
2560×1400
2880×1800 for Retina display

BuddyPress Logo (SVG)

Dashicons Icons

BuddyPress Logo: content: "f448"; – class="dashicons dashicons-buddypress-logo"
BuddyPress Activity: content: "f452"; – class="dashicons dashicons-buddypress-activity"
BuddyPress Community: content: "f307"; – class="dashicons dashicons-buddypress-community"
BuddyPress Friends: content: "f454"; – class="dashicons dashicons-buddypress-friends"
BuddyPress Groups: content: "f456"; – class="dashicons dashicons-buddypress-groups"
BuddyPress PM: content: "f457"; – class="dashicons dashicons-buddypress-pm"
BuddyPress Tracking: content: "f???"; – class="dashicons dashicons-buddypress-tracking"

在辅助博客上安装

在辅助博客上安装

Codex Home → Legacy Docs → Archived Section: Getting Started → Installing on a Secondary Blog
Installing on a Secondary Blog

Archived file. Good only up to BP 1.5 version

***The following pertains to administrators using WordPress 3.0 in network mode)***
This option might appeal to you if you want to style and theme BuddyPress differently than your root blog.
For example, say you have an existing WordPress setup located at hxxp://example.com, but you really want to have BuddyPress located at hxxp://example.com/community (if you setup your network as a subdirectory install) or hxxp://community.example.com (if you setup your network as a subdomain install).
Interested? Read on!
(1) Configure the BP_ROOT_BLOG:
In order to run Buddypress on a secondary blog, you should create a second blog and modify BuddyPress』 internal settings to set your new blog as the BP root blog.
Next, define the 『root』 blog you would like BuddyPress to reside at by adding the code snippet below to wp-config.php:
define ( 'BP_ROOT_BLOG', $blog_id );
Example:
define ( 'BP_ROOT_BLOG', 3 );
Note: In WordPress 3.1, your $blog_id can be found by navigating to the 「Network Admin > Sites」 page and hovering over the blog in question. You should see a link that resembles this:
http://example.com/wp-admin/network/site-info.php?id=1
Your $blog_id, in this instance, would be 1.
For WordPress 3.0, the $blog_id can be found in the 「ID」 column of the 「Super Admin > Blogs」 page.
(2) Activate the BuddyPress plugin and a BuddyPress-enabled theme
Now that you have defined the BP root blog, activate a BuddyPress-enabled theme on this blog such as the 「BuddyPress Default」 theme.
(3) Keep your old BuddyPress user / group avatars
Note: This does not apply to fresh BuddyPress installs!
When you move BuddyPress to a secondary blog, the upload path to your BuddyPress avatars will change. This means your avatars will be lost.
Don』t fret though! To have your old BuddyPress user and group avatars linked from their old location, add the following lines to your bp-custom.php file:
define( 'BP_AVATAR_UPLOAD_PATH', 'YOUR_ABSOLUTE_PATH_TO_YOUR_OLD_BP_LOCATION' );
define( 'BP_AVATAR_URL', 'YOUR OLD BUDDYPRESS URL' );
For example, say you previously installed Buddypress on your root blog (blog id #1) at hxxp://example.com, you would fill in:
define( 'BP_AVATAR_UPLOAD_PATH', '/var/www/wp-content/blogs.dir/1/files' );
define( 'BP_AVATAR_URL', 'hxxp://example.com/files' );
(4) Redirect previous BuddyPress permalinks
Note: This does not apply to fresh BuddyPress installs!
Now that you have BuddyPress setup under a secondary blog, you will want to redirect your old BuddyPress permalinks so they』ll successfully resolve to their new location.
*** The following example is for a BP install on a network subdirectory setup, if you』re using a network subdomain install, your .htaccess rules will be a variation on what is posted below ***
eg. Old BuddyPress location -> New BuddyPress location
hxxp://example.com -> hxxp://example.com/community/
hxxp://example.com/members/admin -> hxxp://example.com/community/members/admin
hxxp://example.com/groups/ -> hxxp://example.com/community/groups/
hxxp://example.com/blogs/ -> hxxp://example.com/community/blogs
To do this, navigate to where your wp-config.php file is located and in the same directory, there should be a .htaccess file.
Open this file in a text editor.
Above the line:
# add a trailing slash to /wp-admin
Add the following:
RedirectMatch 301 ^/members/(.*)$ http://example.com/community/members/$1
RedirectMatch 301 ^/groups/(.*)$ http://example.com/community/groups/$1
RedirectMatch 301 ^/blogs/(.*)$ http://example.com/community/blogs/$1
RedirectMatch 301 ^/forums/(.*)$ http://example.com/community/forums/$1

Now you can enjoy your BuddyPress install at its new location!
* Posted by r-a-y.

主题和 BuddyPress 模板包

主题和 BuddyPress 模板包

Codex Home → Legacy Docs → Archived Section: Theme Development → Themes & the BuddyPress Template Pack
Themes & the BuddyPress Template Pack

Archived file. Good up to BP 1.6.5 version

To enable your existing WordPress theme for BuddyPress, please download and activate the BuddyPress Template Pack plugin. This will run you through the process step-by-step.
The Process At-A-Glance
This requires a working knowledge of HTML and CSS at the very least.
After you install and activate the BP Template Pack plugin, head over to admin dashboard > Appearance > BP Compatibility panel.
Step One: Moving template files automatically
BuddyPress needs some extra template files in order to display its pages correctly. This plugin will attempt to automatically move the necessary files into your current theme.
Click the button below to start the process.
Move Template Files
Click on 「Move Template Files」 link
Templates moved successfully!
Great news! BuddyPress templates are now in the correct position in your theme, which means that we can skip Step Two: Moving Templates Manually, and move directly to Step Three. Cool!
Continue to Step Three.
Click on 「move on to step three」 link
Step Three: Tweaking your layout
Now that the template files are in the correct location, check out your site. (You can come back to the current page at any time, by visiting Dashboard > Appearance > BP Compatibility.) You should see a BuddyPress admin bar at the top of the page. Try visiting some of the links in the 「My Account」 menu. If everything has gone right up to this point, you should be able to see your BuddyPress content.
If you find that the pages are not quite aligned correctly, or the content is overlapping the sidebar, you may need to tweak the template HTML. Please follow the 「fixing alignment」 instructions below. If the content in your pages is aligned to your satisfaction, then you can skip to the 「Finishing Up」 section at the bottom of this page.
Fixing Alignment
By default BuddyPress templates use this HTML structure:

[ CONTENT ]

If BuddyPress pages are not aligned correctly, then you may need to modify some of the templates to match your theme』s HTML structure. The best way to do this is to access your theme』s files, via FTP, at:
/xxxxx/wp-content/themes/twentyeleven/
Open up the page.php file (if this does not exist, use index.php) of your active/preferred WP theme. Make note of the HTML template structure of the file, specifically the div tags that surround the content and sidebar.
There are two methods for making the necessary template changes.
A. The first method is to change the HTML structure in the following BuddyPress template files which were transferred into your active/preferred WP theme to match the structure of your WP theme』s page.php or index.php file.

/activity/index.php
/blogs/create.php
/blogs/index.php
/forums/index.php
/groups/index.php
/groups/create.php
/groups/single/home.php
/groups/single/plugins.php
/members/index.php
/members/single/home.php
/members/single/plugins.php
/members/single/settings/delete-account.php
/members/single/settings/general.php
/members/single/settings/notifications.php
/registration/activate.php
/registration/register.php

B. Alternatively, you may find it easier to make copies of your theme』s header.php, sidebar.php and footer.php and rename them to header-buddypress.php, sidebar-buddypress.php, and footer-buddypress.php.
Then you can alter the structure of these new template files (header-buddypress.php, sidebar-buddypress.php, and footer-buddypress.php) to resemble your theme』s page.php (or index.php).
Once you are done matching up the HTML structure of your theme in these template files, please take another look through your site. You should find that BuddyPress pages now fit inside the content structure of your theme.
Finishing Up
You』re now all done with the conversion process. Your WordPress theme will now happily provide BuddyPress compatibility support. Once you hit the finish button you will be presented with a new permanent theme options page, which will allow you to tweak some settings.
Finish
Click on 「Finish」 link
Final Steps
__Disable BP Template Pack CSS
The BuddyPress template pack comes with basic wireframe CSS styles that will format the layout of BuddyPress pages. You can extend upon these styles in your theme』s CSS file, or simply turn them off and build your own styles.
___Disable BP Template Pack JS / AJAX
The BuddyPress template pack will automatically integrate the BuddyPress default theme javascript and AJAX functionality into your theme. You can switch this off, however the experience will be somewhat degraded.
Save Settings
NOTE: To remove the 「BuddyPress is ready」 message you will need to add a 「buddypress」 tag to your theme. You can do this by editing the style.css file of your active theme and adding the tag to the 「Tags:」 line in the comment header.
Navigation Links
You may want to add new navigation tabs or links to your theme to link to BuddyPress directory pages. The default set of links are:

Activity: http://yoursite.com/activity/
Members: http://yoursite.com/members/
Groups: http://yoursite.com/groups/
Forums: http://yoursite.com/forums/
Register: http://yoursite.com/register/ (registration must be enabled)
Blogs: http://yoursite.com/blogs/

Reset Setup
If you would like to run through the setup process again please use the reset button (you will start at step three if you haven』t removed the template files):
Reset
Template-Packed WordPress Themes
Default WordPress Themes

Twenty Eleven Theme – BuddyPress Codex Walkthrough, BP 1.5, using second method
Twenty Ten Theme – BuddyPress Codex Walkthrough, BP 1.5, using second method

WordPress Themes Repository

Admire Theme – TBA
Admired Theme – http://wp.me/p1I84P-1l
Adventure Journal Theme – BuddyPress Forums
Atahualpa Theme – BuddyPress Forums
anIMass Theme – BuddyPress Forums
Canyon Theme – BuddyPress Forums
Catch Box Theme – BuddyPress Forums
DailyPost Theme – BuddyPress Forums
Delicate Theme – BuddyPress Forums
Easel Theme – http://wp.me/p1I84P-1y
Esplanade Theme – http://wp.me/p1I84P-31
Graphene Theme – BuddyPress Forums
iFeature Free – BuddyPress Forums
Mammoth Theme – BuddyPress Forums
Mantra Theme – BuddyPress Forums
Minimatica Theme – BuddyPress Forums
Motion Theme – BuddyPress Codex Walkthrough, first method
Mystique Theme – BuddyPress Forums
Pinboard Theme – http://wp.me/p1I84P-V
Platform Theme – BuddyPress Forums
PulsePress Theme – http://wp.me/p1I84P-3t
Sliding Door Theme – BuddyPress Forums
Thematic Child Theme – BuddyPress Forums
TP Sunrise Theme – BuddyPress Forums
Wallow Theme – http://wp.me/p1I84P-3x
Weaver Theme – BuddyPress Forums
WP Creativix Theme – BuddyPress Forums
Yoko Theme – http://wp.me/p1I84P-3b

Other WordPress Themes

13th Floor, Elegant Themes – BuddyPress Forums
Aggregate Theme, Elegant Themes – BuddyPress Forums
Alyeska Theme, Themeforest – BuddyPress Forums
Amplifier Theme, Themeforest – BuddyPress Forums
Artisteer Theme, Artisteer – BuddyPress Forums
Avenue Theme, Themeforest – http://wp.me/p1I84P-3J
Backstreet Theme, Themeforest – http://wp.me/p1I84P-1p
Basic Theme, Elegant Themes – http://wp.me/p1I84P-1u
BlackLight Theme, Theme Junkie – BuddyPress Forums
Blogging News Theme, Colorlabs – BuddyPress Forums
Bold Theme, Solostream – BuddyPress Forums
Boulevard Theme, Themeforest – BuddyPress Forums
Canvas Child Theme, Wootheme – BuddyPress Forums
Canyon Theme, Themeforest – BuddyPress Forums
CelebrityPress Theme, Gorilla Themes – http://wp.me/p1I84P-3z
Chameleon Theme, Elegant Themes – http://wp.me/p1I84P-3L
Collection Theme, Theme Junkie – http://wp.me/p1I84P-1B
Complete Theme, WP Explorer – http://wp.me/p1I84P-1n
Continuum Theme, Themeforest – http://wp.me/p1I84P-36
Delicious Magazine Theme, Woothemes – BuddyPress Forums
Denizen Theme, Themeforest – BuddyPress Forums
Diner Theme, Woothemes – BuddyPress Forums
Duotive Three, Themeforest – BuddyPress Forums
Eclipse Theme, Themeforest – http://wp.me/p1I84P-1g
eNews Theme, Elegant Themes – BuddyPress Forums
Envision Theme, Themefuse – BuddyPress Forums
Evolution Theme, Elegant Themes – BuddyPress Forums
Facepress Theme, Themeforest – http://wp.me/p1I84P-O
Flare Theme, Themeforest – http://wp.me/p1I84P-2P
Fullscreen Business Portfolio Theme, Themeforest – BuddyPress Forums
Gonzo Theme, Themeforest – http://wp.me/p1I84P-K
Harmony Theme, Elegrant Themes – http://wp.me/p1I84P-3R
iFeature4 Pro, Cyberchimps – BuddyPress Forums
Insignio Portfolio Theme, Themeforest – BuddyPress Forums: two columns, full width
InStyle Theme, Elegant Themes – old version at and Version 2.7 at http://wp.me/p1I84P-3H
Karma Theme, Themeforest – BuddyPress Forums
Listings, Woothemes – BuddyPress Forums
Lucid Theme, Elegant Themes – http://wp.me/p1I84P-E
Memo Theme, Premium Pixels – BuddyPress Forums
Merchant Theme, Themeforest – http://wp.me/p1I84P-1b
Metrolo Theme, ThemeState – BuddyPress Forums
Minimosity Theme, Themeforest – http://wp.me/p1I84P-2X
Modernize Theme, Themeforest – http://wp.me/p1I84P-1J
Music Theme, Netlabs – http://wp.me/p1I84P-18
MusicLife Theme, Fthemes – http://wp.me/p1I84P-1D
Neu Theme, ColorLabs – BuddyPress Forums
Nevada Theme, Themeforest – http://wp.me/p1I84P-34
Paradise Theme, Themeforest – http://wp.me/p1I84P-3r
Peekaboo Theme, Themeforest – BuddyPress Forums
Professional Theme, Elegant Themes – BuddyPress Forums
Puretype Theme, Elegant Themes – BuddyPress Forums
Quik Gallery, WP Explorer – BuddyPress Forums
Quickstart Theme, Gabfire – BuddyPress Forums
Ray of Light Theme, Themeforest – BuddyPress Forums
Reaction Theme, Themeforest – BuddyPress Forums
Risen Theme, Themeforest – BuddyPress Forums
Sahifa Theme, Themeforest – http://wp.me/p1I84P-3m
Shoutbox Theme, Themeforest – BuddyPress Forums
Simpfolio Theme, Slimmity – http://wp.me/p1I84P-3i
Smileth Theme, MyReviewPlugin – BuddyPress Forums
SMPL Theme, Woothemes – BuddyPress Forums
Sportsmag, Magazine3 – http://wp.me/p1I84P-3f
Strings Theme, Themeforest – http://wp.me/p1I84P-3o
Swagger Theme, Themeforest – http://wp.me/p1I84P-1F
Swatch Theme, Woothemes – BuddyPress Forums
Telegraph Theme, WPZoom – BuddyPress Forums
The Morning After Theme, Woothemes – http://wp.me/p1I84P-2Z
The Secret World Theme – http://wp.me/p1I84P-3F
The Source Theme, Elegant Themes – BuddyPress Forums
TheStyle Theme, Elegant Themes – BuddyPress Forums
Unstandard Theme, Themetie – BuddyPress Forums
Vagenta Theme, Themeforest – http://wp.me/p1I84P-2M
Volt Theme, Themeforest – http://wp.me/p1I84P-3k
Wallbase Theme, Web2Feel – BuddyPress Forums
Wikeasi Theme, WooThemes – BuddyPress Forums
Wisdom of Life Theme, Themeforest – http://wp.me/p1I84P-15
Wowway Theme, Themeforest – http://wp.me/p1I84P-38D
WP Bold, Solostream (partial – registration only) – http://wp.me/p1I84P-2U
WP Chatter Theme, Solostream – BuddyPress Forums
WP Church Theme, Themeforest – BuddyPress Forums
WP Clear Theme, Solostream – BuddyPress Forums
WP ClearPhoto Theme, Solostream – BuddyPress Forums
WP ClearVideo Theme, Solostream – BuddyPress Forums
WP DaVinci Theme, Solostream – http://wp.me/p1I84P-1H
WP Flexishop Theme, Themeforest – BuddyPress Forums
WordPress Theme 778, Template-help.com – BuddyPress Forums
yserif Theme, Yoarts.com – BuddyPress Forums

检查 BuddyPress

检查 BuddyPress

Codex Home → BuddyPress Plugin Development → Checking For BuddyPress
Checking For BuddyPress

Because of the way that WordPress loads plugins, it』s possible that your plugin could load before or after BuddyPress. This makes it difficult to know if BuddyPress is loaded, or if your plugin has the proper functions available that it might need. If you don』t check, and assume BuddyPress is loaded, it could take an entire site down when BuddyPress is upgraded.
It』s really easy to do this. In your plugin, create a loader.php file that will check to see if BuddyPress is active, and only then load code that relies on BP:
?12345678910111213141516171819/*Plugin Name: My PluginPlugin URI: http://example.org/my-plugin/Description: My BuddyPress pluginVersion: 1.0Requires at least: WordPress 2.9.1 / BuddyPress 1.2Tested up to: WordPress 2.9.1 / BuddyPress 1.2License: GNU/GPL 2Author: Some PersonAuthor URI: http://example.org/me/*/ /* Only load code that needs BuddyPress to run once BP is loaded and initialized. */function my_plugin_init() {    require( dirname( __FILE__ ) . '/my-plugin.php' );}add_action( 'bp_include', 'my_plugin_init' ); /* If you have code that does not need BuddyPress to run, then add it here. */

论坛主题循环

论坛主题循环

Codex Home → Developer Resources → Loops Reference → Forum Topics Loop
Forum Topics Loop

The forum topics loop can be used to output a list of forum topics.
Standard Loop

<tr class="">

<a class="topic-title" href="" title=" - ">

<a href="">

<a href="">

<a href="" title="">

Accepted Parameters
The bp_has_forum_topics() function will accept a number of parameters that will manipulate the data being returned.

type optional
List forum topics by type.

Accepted arguments: newest,popular,unreplied,tags (if type equals 「tags」, define the 「search_terms」 argument and list the tag you wish to filter by)
Default value: newest

forum_id optional
Return only forum topics from a specific group forum.

Default value: false

user_id optional
Return only forum topics that this user has started.

Default value: false

per_page optional
Number of forum topics to display in the loop.

Default value: 20

page optional
The page to display.

Default value: 1

max optional
The total number of forum topics to return.

Default value: false (no limit)

no_stickies optional
Return 「false」 if you do not want stickies listed at the top of the forum loop.

Default value: all

search_terms optional
Return only groups that match these search terms. When used in conjuction with 「type=tags」, can use search_terms to define the tag name.

Default value: false

Examples
Modifying the forum loop to list forum topics by most popular:

群组设置和角色

群组设置和角色

Codex Home → Administrator Guide → Group Settings and Roles
Group Settings and Roles

BuddyPress allows any member to create a group around a common interest or purpose. Here are some basic settings that will help you get your BuddyPress groups up and running.
Privacy Options
When creating a group, you have the option of making your group Public, Private, or Hidden.

Public groups are visible in all group directories. The contents of the group – activity updates, forum posts, and any additional group functionality you might add through plugins – is publicly accessible. Anyone in your BuddyPress community can join a Public group.
Private groups are also visible in group directories. The group name and group description remain available for all to see. However, the contents of the group are accessible only to members. Moreover, group membership is controlled: members of your broader BuddyPress community must request membership, which can only be granted by a group administrator.
Hidden groups are invisible to non-members. These group names and descriptions are not listed in sitewide directories, and their contents are accessible only to members of the group. Because the group is unlisted, users cannot request membership. Instead, individuals can only join the group by invitation.

Group administrators can change a group』s privacy settings at any time by visiting the group』s Admin tab > Group Settings.
Group roles
BuddyPress group members have three roles available to them.

Members: By default, when a user joins a group, he or she has the role of member. What does it mean to be a member of a BuddyPress group? That depends on what kind of group it is.

In a public group, members are able to post to that group』s forums, as well as submit content to other parts of the group (for instance, group members can upload documents in conjunction with the BuddyPress Group Documents plugin). When a user posts to the discussion forum of a public group, the user automatically becomes a member of the group. Additionally, being a member of a group means having the group』s activity aggregated in your Activity > My Groups activity stream.
In a private group or a hidden group, members have all the same privileges as members in a public group. Additionally, being a member of a private group means that you get to see who else is a member of the group, and that you』re able to send invites to other users.

Moderators: When a group member is promoted to be a moderator of the group, it means that the member receives the following additional abilities:

Edit group details, including the group name and group description (see: #4737)
Edit, close, and delete any forum topic or post in the group
Edit and delete other kinds of content, as produced by certain plugins

Administrators: Administratorshave total control over the contents and settings of a group. That includes all the abilities of moderators, as well as the ability to:

Change group-wide settings (Admin > Settings). For instance, administrators can turn group forums on or off, change group status from public to private, and toggle on or off various other group functionality provided by plugins
Change the group avatar (Admin > Group Avatar)
Manage group members (Admin > Manage Members). More specifically, only group administrators have the power to promote members to moderators, or to ban individual users from the group
Delete the group (Admin > Delete)

The individual who creates the group is automatically the group』s first administrator. As a result, each group must have at least one administrator, though the first admin can choose to appoint others.