使用内置的 WordPress 菜单

使用内置的 WordPress 菜单

Codex Home → Legacy Docs → Archived Section: Getting Started → Using the Built-in WordPress Menus
Using the Built-in WordPress Menus

The latest BuddyPress 1.5 default theme now includes the standard WordPress menus that you can easily set with drag-and-drop capabilities. You also have quite a bit more control over where your BuddyPress components are now displayed. Here are the basic steps to setting up your main site navigation after BuddyPress is installed. (*Please note that this only applies to BP 1.5+)
Step 1: Assign BuddyPress components to their own pages.
If you want to house a component under a unique page name, then you will need to create that page first. For example, let』s say you want 「Forums」 to be accessed on a page called 「Discussion」. Create a blank page titled 「Discussion」 first.
Navigate to Dashboard > BuddyPress > Pages

Assign each of your active components to a page using the dropdown menu.
Step 2: Create your main navigation menu.
You can create your own customized menu for your BuddyPress site, just like you normally would with WordPress.
Go to Dashboard > Appearance > Menus
Create a new menu by giving it a title and dragging and dropping your desired pages.

To add links specific to the logged-in user, enable the 「BuddyPress」 option box:

And select the items you would like to add to your menu:

Step 3: Assign your menu as the primary navigation.
The default BuddyPress theme supports one menu – the primary navigation. Go to Theme Locations within the menu creation area and assign the menu you just created as the Primary Navigation for your site. Click save and refresh your site to see your new custom menu in place.

安装群组和全站论坛 (v1.6)

安装群组和全站论坛 (v1.6)

Codex Home → Legacy Docs → Archived Section: Getting Started → Installing Group and Sitewide Forums (v1.6)
Installing Group and Sitewide Forums (v1.6)

Archived file. Good up to BP 1.6.5 version

Installing Group and Sitewide Forums (v1.6)
The following is a step-by-step illustrated guide for installing the Group and/or Sitewide Forums (bbPress 2.1) for BuddyPress 1.6+ on WordPress 3.4.1 after completing the BuddyPress installation wizard.
Forums Setup
Forums in BuddyPress make use of the bbPress software to function and we made it easy for you to install from the wp-admin backend with a few clicks. Depending on your community』s requirements, you can choose to:

Set up new Forums for Groups only (internal bbPress setup),
Use Existing Installation of Forums for Groups only (internal bbPress setup – upgrading from BP 1.2+),
Set up Sitewide Forums only (integration with bbPress 2.0+ plugin – new in BP 1.5), or
Set up Forums for Groups and Sitewide Forums

Forums FAQ』s (Frequently Asked Questions)
What』s the difference between Forums for Groups and Sitewide Forums?
Forums for Groups:
Give each individual group its own discussion forum. Choose this if you』d like to keep your members』 conversations separated into distinct areas. You may use an existing bbPress installation if you have one.
Features:

Group Integration
Member Profile Integration
Activity Stream Integration
@ Mention Integration

In other words, the bbPress Forums for Groups in BuddyPress are fully integrated and attached to Groups instead of the categorical and hierarchical format available in the bbPress Sitewide Forums. The Group/Site/Super Admin has to enable the forum feature in the Group』s admin panel first.
Site Wide Forums:
Your site will have central forums that are not isolated to any specific group. Choose this if you』d like to have a central forum area for your members.
Features:

Central Discussion Area
Forum Plugins Available
Activity Stream Integration
@ Mention Integration

A. Installing Forums for Groups only
Step 1. Go to admin dashboard > Settings > BuddyPress > Forums. Click on "Install Group Forums"

Step 2. New bbPress Installation. You』ve decided to set a new bbPress for forum management in BuddyPress. This is very simple and is usually just a one click process. When you』re ready, hit the link below. Click on "Complete Installation"

Step 3. All done! Configuration settings have been saved to the file bb-config.php in the root of your WordPress install.

If you kept the original page name/slug, Forums, for your Group Forums during the Installation Wizard then just proceed to http://yoursite.com/forums and you』ll find the Group Forums Directory page.
If you changed the page name/slug to e.g. 「Our Forums」 by creating a new Page named 「Our Forums」 then associated it with the Discussion Forums in BuddyPress > Pages, re-run Dashboard > Settings > Permalinks > Save, then proceed to http://yoursite.com/our-forums
Step 4. Create a New Group and Set Up the Group』s Discussion Forums
a. Go to the Groups Directory in the frontend and click on the 「Create a New Group」 button.
b. Add Details about the Group -> Group Name and Group Description
c. Choose your preferences for the following features -> Privacy Options, Group Invitations and Group Forums where you click on the checkbox to 「Enable Discussion Forums」
d. Proceed to the next steps of to finalize Group creation -> Uploading Group Avatar (or not) and then to the Invites panel where Group Admins can only invite friends while Super Admin can invite anyone.
B. Use Existing Installation of Forums for Groups only
Step 1. If you already have an existing bbPress installation for Groups, go to admin dashboard > BuddyPress > Forums and click on "Use Existing Installation"

Step 2. Existing bbPress Installation
BuddyPress can make use of your existing bbPress install. Just provide the location of your bb-config.php file, and BuddyPress will do the rest. bb-config.php file location: (shows path where bb-config.php is expected to be found) Click on "Complete Installation"

Step 3. If the path to your existing bb-config.php was incorrect, you』ll receive an error message 「The bb-config.php file was not found at that location, please try again.」 Find where that bb-config.php is and make sure you have the right path when you go through the process again.
If the path to your existing bb-config.php is correct, you』ll receive a congratulatory message and you can proceed to home page and test drive your Group Forums.
C. Set Up Sitewide Forums only
Since you are setting up Sitewide Forums only, disable (uncheck) Discussion Forums in the Settings > BuddyPress > Components panel.

Step 1. Go to wp-admin dashboard menu Settings > BuddyPress > Forums and click on "Install Sitewide Forums"

Step 2. The box below will show up on screen. Click on the red "Install" button

Step 3. Click on the "Activate Plugin" link

Step 4. Activating the bbPress plugin brings you to the Installed Plugins panel. You』ll already find the new 「Forums」, 「Topics」, and 「Replies」 navigation links added in dashboard menu under the 「Comments」 menu. We』ll explore the forum links later as we need to finish configuring the Sitewide Forums first.
Look for bbPress in the the list and beside the plugin nane, Click on the Settings link or go to Settings > Forums

Step 5. This opens up the Forums panel where you』ll be able to further configure the Sitewide Forums. Since this is your only bbPress Forum installation, you can keep the 「forum」 as your Forums base under Archive Slugs. Keep default configuration or make your modifications then click on "Save Settings"
Note: During the Installation Wizard, Forums will be associated with the 「Forums」 page. In some installations, you do not need to change anything. But if your sitewide forums won』t work, go to wp-admin BuddyPress > Pages and you』ll find the association and remove the Forums Page as the selected page.

Step 6. Go to dashboard menu Forums > New Forum to Create New Forum to test.

Step 7. This brings us to the Create New Forum panel. In this example, we』ll add an 「Announcements」 forum then click on the "Publish" button.

Step 8. Check out your new forum. Click on "View Forum" link.

Step 9. This is how your new 「Announcements」 forum would look like.
[Note: You will have to create the link to your sitewide forums page in your custom menu or main navigation. The menu links in the image below were created prior to setting up this tutorial.]

Step 10. Create a new Topic under the Announcements Forum. Enter the Topic Title, Topic Description, Topic Tags, and Topic Type. The Topic Types- Normal, Sticky and Super Sticky – can be set by the Forum Key Master. Although hidden in image below, you can check 「Notify me of follow-up replies via email.」 After you finish with creating your topic, click on the "Submit" button".

Step 11. Congratulations! Your Topic has been posted under the 「Announcements」 Forum.

Step 12. Now go Create New Forums as needed in your social network and open up for business!
NOTE: For more information about how to use bbPress forums, please read https://codex.bbpress.org/getting-started-with-bbpress/
D. Installing Forums for Groups AND Sitewide Forums
You may activate both Group and Site Wide forums, but this may create a poor experience for your members. Having said that, if you still want to proceed with setting up both forums to meet your social network』s requirements, read on.
「Forums」 Page Slug issue:
If you』re going to install Sitewide Forums only, it gets the Forums slug automatically.
However, if you』re going to install both Forum for Groups and Sitewide Forums, know that Forums for Groups (internal bbPress installation) has priority over the 「forums」 page/slug under the Discussion Forums page as seen in BuddyPress > Pages over the Sitewide Forums (bbPress 2.0 the plugin). The conflict arises because the Archived Slugs -> Forums base for Sitewide Forums is also 「forums」. Uh-oh.
There are three ways to set up both forums and prevent conflict on the page slugs:
1. Change the Forums for Groups page slug OR
2. Change the Sitewide Forums archived page slug OR
3. Change slugs of both Forums for Groups and Sitewide Forums
1. Change the Forums for Groups page slug
In this example, we』ll set 「group-forums」 slug for our install』s Forums for Groups and use the 「forums」 slug for our Sitewide Forums.
a) Go to Dashboard > Pages > Add New and name that page, Group Forums, and click on the "Publish" button

b) Go to admin Dashboard > BuddyPress > Pages and change the Page assigned to the Discussion Forums component to the new Group Forums Page created above. Click on the "Save" button on the same line as Discussion Forums.

c) Settings saved. Go to your home page.

d) Click on the Group Forums link in bp-default theme』s main navigation and you』ll see the group Forums Directory page. Before you can add a new Topic, you would need to create a group first because each Topic should be associated to a certain group.

e) Now go back to admin Dashboard > BuddyPress > Forums and click on "Install Sitewide Forums"

f) Continue with the installation as seen on Set up Sitewide Forums only.
g) Everything looks good … except what』s this? Clicking on the 「Forums」 link in main navigation leads to an empty page titled Forums(!). There』s a solution for that.
– Go Dashboard > Pages > All Pages
– Edit the Forums page
– Add the bbPress shortcode 「bbp-forum-index」 and click on the "Update" button. Check out the other bbPress shortcodes you can add to your Forums page from this bbPress 2.0 shortcodes list by John James Jacoby, Lead Developer of BuddyPress and bbPress plugins.
h) Re-run permalinks via Dashboard > Settings > Permalnks > and Save Settings.
2. Change the Sitewide Forums page slug
In this example, Forums for Groups will retain the 「forums」 slug while we』re going to change the Sitewide Forums Base Slug to 「sitewide-forums」.
a) Follow the installation instructions of a new Forums for Groups only or that of Existing Installation of Forums for Groups.
b) Follow the installation instructions of the new Sitewide Forums until at Step 5 when you reach the Settings > Forums panel. Go down the panel to the 「Archive Slugs」 section and in the text area provide for 「Forums Base」, change 「forums」 to 「sitewide-forums」 (without the apostrophes). Click on the "Save Changes" button
c) Then continue on with Step 6 of the Sitewide Forums installation till end of the page.
d) Create a link for the Sitewide Forums in Dashboard > Appearance > Menus
e) Re-run permalinks via Dashboard > Settings > Permalnks > and Save Settings.
3. Change the slugs of Forums for Groups and the Sitewide Forums
In this example, I would like my Group Forums to named as 「Support」 and my Sitewide Forums to be 「Discussions.」
a) Forums for Groups:

Rename the 「Forum」 Page created during the installation wizard procedure by going to Dashboard > Pages > All Pages, click on Edit link for the 「Forums」 page.
Change 「Forums」 to 「Support」 (without the apostrophes) in title area and 「support」 in slug area below the title.
Click on the "Publish" button.
Go to Dashboard > BuddyPress > Pages.
In Directories – Discussion Forums – select 「Support」 from dropdown and click on the 「Save」 button in same line.
Go to Dashboard > Appearance > Menus and add the 「Support」 page to your custom menu.

b) Sitewide Forums:

Go to Dashboard > Pages > Add New
In Add New Page panel, put 「Discuss」 as page title and add 「bbp-forum-index」 shortcode to start off as seen on this page https://bbpress.org/forums/topic/bbpress-20-shortcodes
Click on the "Publish" button.
Go to Dashboard > Settings > Forums
In the bbPress Settings panel, go down to 「Archive Slugs」 – 「Forums Base」 and change 「forums」 to 「discussions」
Click on the "Save Settings" button.
Re-run permalinks via Dashboard > Settings > Permalnks > and Save.
Add new Forums via Dashboard > Forums > Add New panel.
Go to Dashboard > Appearance > Menus and add the 「Discussions」 page to your custom menu.

bbPress Forums Tables in Database
The installation of BuddyPress internal bbPress forums, Group Forums, adds seven (7) new tables to your database:

yourPrefix_bb_forums
yourPrefix_bb_meta
yourPrefix_bb_posts
yourPrefix_bb_terms
yourPrefix_bb_term_relationships
yourPrefix_bb_term_taxonomy
yourPrefix_bb_topics

.
Database tables of a single WordPress installation generated when internal bbPress – Group Forums – is activated.

Database tables of a WordPress Multisite installation (other subsite tables deleted) generated when internal bbPress – Group Forums – is activated.

E. Forums: Frequently Asked Questions
How can I enable my Group』s forum?

Create a Group – only Group Admin/s and Site/Super Admin can enable the group』s forum
Go to the group』s 「Admin」 link
Select Group Settings
Check 「Enable Forum」 box and save settings
Create a Topic to test

How can I migrate my Group Forums to the Sitewide Forums?
Migration script to transfer Group Forums to Sitewide Forums is not available at this time.
I cannot uninstall the Forums for Groups. When i click uninstall group forums, it just re-initiates itself. What step am I missing?
First, back up your database and the bb-config.php file which was generated in root of your WordPress install when you installed Forums for Groups. Delete bb-config.php file from server.
I installed this cool bbPress add-on plugin and it』s only working in my Sitewide Forums but not in my Group Forums. What』s wrong with my installation?
Unless it is specifically stated as a plugin for the BuddyPress group forums, all add-on bbPress plugins are specifically for the Sitewide Forums (bbPress 2.0, the plugin).

bp-custom.php

bp-custom.php

Codex Home → BuddyPress Theme Development → bp-custom.php
bp-custom.php

You』ve probably heard a lot of talk about a bp-custom.php file on the BuddyPress forums or WordPress forums.
So what is it?
bp-custom.php is a file that resides in your WordPress 『plugins』 folder where you can add a bunch of custom code hacks and modifications to BuddyPress.
bp-custom.php is often compared to your theme』s functions.php file.
However, there are two primary differences between bp-custom.php and your theme』s functions.php.

First, bp-custom.php runs from the /wp-content/plugins/ folder and is therefore independent from your theme. This is useful for adding code snippets that are BuddyPress-specific. Also, this code will always load regardless of what theme you are using.
Secondly, bp-custom.php runs early in the BuddyPress-loading process. This allows you to override various settings in BuddyPress.

Choosing which file to place your code snippet in is largely a matter of choice. If you are packaging a BuddyPress theme, then you might want to consider using your theme』s functions.php instead. However, for the most part, you should use bp-custom.php.
Creating your file
bp-custom.php does not exist by default. If you don』t have a file located at /wp-content/plugins/bp-custom.php, go ahead and create a blank file with the following:

Next, save the file as 「bp-custom.php」 and verify that this file is located at /wp-content/plugins/.
Now, when you encounter a forum thread telling you to put a code snippet in bp-custom.php, you』ll know what to do!
Examples
Removing the links automatically created in a member』s profile
This can be done by adding the following function to the bp-custom.php file.
BP 1.2.9
function remove_xprofile_links() {
remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 50, 2 );
}
add_action( 'plugins_loaded', 'remove_xprofile_links' );
BP 1.5 +
function remove_xprofile_links() {
remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 );
}
add_action( 'bp_init', 'remove_xprofile_links' );
Defining custom slugs
Developers may modify the default URL slugs for activity, forums, etc by adding a statement in the bp-custom.php file.
// change 'discuss' to whatever you want
define( 'BP_FORUMS_SLUG', 'discuss' );

See the customizing labels messages and urls article for more information on modifying slugs.

模板包演练 - 简单级别

模板包演练 - 简单级别

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

Archived file. Good only up to BP 1.6.5 version

BP TEMPLATE PACK 1.0.2 with MOTION THEME 1.0.7 on WORDPRESS 3.0.1 and BUDDYPRESS 1.2.5.2
After moving the BP Template Pack component folders into your active WordPress theme in Step 1 and getting a success message in Step 2 regarding the transfer, you will proceed to Step 3 where you』ll be asked to check if the HTML structure is aligned. To illustrate this step, we will be using the 2-column Motion Theme which is available for download at the WordPress Themes repository.
Motion Theme
Going Through the BP Template Pack Compatibility Process
Activating the BP Template Pack plugin and going through the first two steps of the process do not affect the layout of the regular pages as seen below except to add the BP Admin Bar positioned above the body of the theme.

Going to the site』s activity page (http://yoursite.com/activity/) however, you』ll find that some elements of the BuddyPress components need to be tweaked.

We need to compare the template structures of the Motion Theme with the BP templates which have been transferred to the folder of your active theme and transpose the HTML structure of the Motion Theme onto the 13 Template Pack files. (Note: 16 template files as of BP 1.5)
BP templates use this HTML structure by default:
[HEADER]

[PAGE CONTENT]

[FOOTER]

Full Width and/or 2-Column Layout for BP Components
Per instructions in Step 3, you should look at the page.php or the index.php file of your active WP theme and copy the HTML structure there onto the 13 BP template files (Note: 16 template files as of BP 1.5).
The Motion theme has a full width structure (no sidebar) instead of a 2-column layout in its page.php and a 2-column layout in its index.php. We』ll be covering both layouts.
A. Full Width Layout
This is the HTML structure of Motion Theme』s page.php
[HEADER]

[PAGE CONTENT]


[FOOTER]

If you choose to have full width pages for your BuddyPress components, starting with the activity/index.php file which is now in your Motion Theme』s folder you will need to replace

with

Then at the bottom part of activity/index.php, replace

with

After which, you then make the same revisions in the remaining template files as indicated in the instructions in Step 3 of the process.
Note: list below has been updated to show the 16 template files which need to be revised.

/activity/index.php – DONE above
/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. 2-Column Layout
If you prefer to have a 2-column layout for your BP component pages, open up Motion theme』s index.php file and you』ll see the HTML structure like so:
[HEADER]

[PAGE CONTENT]

[FOOTER]

The template file structure of Motion Theme』s 2-column layout is the same as the default BP Template Pack』s files』. You only need to modify the name of the container div from id=」container」 to id=」main」. Replace

with

starting with the activity/index.php then apply revision to the remaining BP template files which need to be revised per list.
An Alternative Way to Implement the 2-column Layout
Fortunately, the Motion theme does not have #container div in any of its template files – checked in style.css and double-checked in header.php. So instead of going through the tedious process of changing the container div from #container to #main in the 13 BP template files (Note: 16 template files as of BP 1.5), it would be much easier to tweak the layout in all aforementioned files by making one change in Motion theme』s style.css.
Add the #container div selector in Motion theme』s style.css file. Change this
#main {
padding: 30px 0 20px 0;
}

to this
#main, #container {
padding: 30px 0 20px 0;
}

That was easy. Using this method, you won』t need to make revisions to 13 template files (Note: 16 template files in BP 1.5) each time the BP Template Pack plugin is updated.
Using Different Layouts for Different Components
Now that you know the HTML structures of Motion theme templates for full width and 2-columns layouts, you have the option to apply full widths to certain BP components and 2-columns for the others. The images below show a member』s activity page with a 2-column format and with a full width format (click on images to enlarge). Your choice.
After you implement the layout/s you preferred for the BP Components in the BP template files, you』re ready to go to the final steps of the process.
Final Steps
A. Add BuddyPress Tag to Motion Theme』s style.css
/*
Theme Name: Motion
...
...
Tags: buddypress, black, blue, green, dark, two-columns, sticky-post, threaded-comments, fixed-width, right-sidebar
...
...
*/

B. Add BP Component Navigation Links
You can add the navigation links for the BuddyPress Components you have enabled for your site in at least three different areas in Motion Theme』s header.php file.
1. Add BP navigation links to div#topmenu in header.php

The result:

2. Replace Category Links in div#catnav

The result:

3. Add a New div Above div#catnav

And use the styling of #catnav in this new div#newbplinks
/************************************************
* New BP Component-specific Links Div *
************************************************/
#newbplinks {
overflow: hidden;
width: 980px;
background: url(images/blacktrans.png);
}

#newbp li {
float: left;
background: url(images/blacktrans.png);
line-height: 2em;
margin: 5px 0 5px 5px;
}
#newbp li:hover {
background: url(images/blacktrans2.png);
}
#newbp li a {
display: block;
margin: 0;
font-size: 0.8em;
color: #fff;
padding: 0 13px;
}
#newbp li a:hover {
color: #afdaff;
text-decoration: none;
display: block;
}
#newbp li ul {
position: absolute;
width: 180px;
left: -999em;
padding-top: 5px;
margin: 0;
}
#newbp li:hover ul,#newbp li.sfhover ul {
left: auto;
}
#newbp li li {
padding: 0;
margin: 0;
width: 180px;
line-height: 1.5em;
}
#newbp li li a {
color: #fff;
margin: 0;
padding: 7px 13px;
background: url(images/blacktrans3.png);
}
#newbp li li ul li {
margin-left: 13px;
}
#newbp li li a:hover {
color: #afdaff;
}
#newbp li:hover,#newbp li.sfhover {
position:static; /* prevents IE7 drop-down menu bug where focus on a page element prevents nested menus from disappearing */
}

The result:

C. Style Elements of BP Component
At this stage, we need to make a few more tweaks to some elements so that the integration of BP components can be completed.
1. Disable BP Template Pack CSS
In the final steps check 「Disable BP Template Pack CSS」 and click on the 「Save Settings」 link. Copy bp.css included in Template Pack and paste at the bottom of Motion Theme』s style.css file.
Change the path of adminbar.css you copied and move it along with the line above it up to right under the stylesheet header.
From
@import url( ../buddypress/bp-themes/bp-default/_inc/css/adminbar.css );

to
@import url( ../../plugins/buddypress/bp-themes/bp-default/_inc/css/adminbar.css );

Move lines to under style.css header
/*
Theme Name: Motion
...
...
Tags: buddypress, black, blue, green, dark, two-columns, sticky-post, threaded-comments, fixed-width, right-sidebar
...
...
*/

/* Load the default admin bar styles */
@import url( ../../plugins/buddypress/bp-themes/bp-default/_inc/css/adminbar.css );

2. Component-specific Styling Tweaks
While some styles from bp.css cover the general layout of the elements within the different components, some additional tweaks are recommended. Some examples:

For this particular theme, you can add this at the bottom of your theme』s style.css to correct font-sizes, alignments, etc.
/************************************************
* Theme-Specific CSS Tweaks *
************************************************/

div.item-list-tabs,
ul.activity-list,
ul.item-list,
div#whats-new-options,
form.dir-form div.dir-search,
div.pag-count,
div.info,
form#forum-topic-form label,
form#forum-topic-form select,
form#forum-topic-form div.submit,
form.standard-form textarea,
div#item-header div#item-header-content,
div#topic-meta a,
form.standard-form input[type="text"] {
font-size: 0.8em;
line-height:1.5em;
}

div#item-header-content h2 a {
font-size: 1.5em;
line-height: 1em;
}

form.dir-form div.dir-search {
margin-top: -20px;
width: auto;
}

form#forum-topic-form {
margin-top: 20px;
}

form.standard-form textarea,
form.standard-form input[type="text"] {
width: 100%;
}

div#item-header div#item-actions {
float:right;
margin:0 0 15px 15px;
text-align:right;
width:20%;
}

div#item-header div#item-actions h3 {
font-size: 0.8em;
line-height: 1em;
margin:0 0 5px;
}

div#topic-meta h3,
div#post-topic-reply h4 {
padding: 15px 0px;
}

div.poster-meta img.avatar {
float: left;
margin: 0px 7px 7px 0px;
}

div.item-list-tabs ul li {
margin-right: 0px;
}

div.item-list-tabs ul li a {
display: block;
padding: 5px 10px 3px 0px;;
text-decoration: none;
}

table.forum {
font-size: 0.75em;
line-height: 1.4em;
width: 100%;
}

table.forum a img.avatar,
table.forum div.poster-name {
float: left;
margin-right: 5px;
}

form#whats-new-form #whats-new-textarea {
margin-top: 10px;
}

div.dir-search label {
display: inline;
}

ul#groups-list li,
ul#members-list li,
ul#blogs-list li,
ul#topic-post-list li {
margin-bottom: 15px;
}

Adjust above styling to taste.

配置组件 (v1.2)

配置组件 (v1.2)

Codex Home → Legacy Docs → Archived Section: Getting Started → Configuring Components (v1.2)
Configuring Components (v1.2)

Archived file. Good only up to BP 1.2 version

After installing and activating BuddyPress, a new menu button with links to help you configure BuddyPress will be added to your dashboard under the Dashboard menu button.
General Settings

Base Profile Group Name
Full Name field name
Enable BuddyPress to WordPress profile syncing?
Hide admin bar for logged out users?
Disable avatar uploads? (Gravatars will still work)
Disable user account deletion?
Disable global forum directory?
Disable activity stream commenting on blog and forum posts?
Default user avatar

Component Setup
By default, all BuddyPress components are enabled. You can selectively disable any of the components by using the form. Your BuddyPress installation will continue to function. However, the features of the disabled components will no longer be accessible to anyone using the site

Activity Streams
Allow users to post activity updates and track all activity across the entire site.
Blog Tracking
Track blogs, blog posts and blog comments for all users across a WordPress Network (or Multisite) installation.
N.B. 「Network mode」 is a feature of WordPress that needs to be manually enabled and configured first. Instructions for enabling this can be found on the WordPress codex WP Codex – Create A Network
bbPress Forums
Activates bbPress forum support within BuddyPress groups or any other custom component.
Friends
Allows the creation of friend connections between users.
Groups
Let users create, join and participate in groups.
Private Messaging
Let users send private messages to one another. Site/Super admins can also send site-wide notices.
Extended Profiles
Activates customizable profiles and avatars for site users.

Forums Setup
Forums in BuddyPress make use of a bbPress installation to function. You can choose to either let BuddyPress set up a new bbPress install, or use an already existing bbPress install. Note that bbPress forums in BuddyPress are fully integrated and attached to groups instead of the categorical and hierarchical format available in an external bbPress forum. Choose one of the options below:

Set up a new bbPress installation
You』ve decided to set up a new installation of bbPress for forum management in BuddyPress. This is very simple process and is usually just a one click process. When you』re ready, click on the 「Complete Installation」 button.

Go to dashboard > BuddyPress menu > Forums Setup.
Click on 「Set up a new bbPress installation」 button.
Click on 「Complete Installation」 button.
All done! Configuration settings have been saved to the file bb-config.php in the root of your WorPress install.
Enable Forum for each Group

Create a Group
Go to the group』s 「Admin」 link
Select Group Settings
Check 「Enable Forum」 box and save settings
Create a Topic to test

Use an existing bbPress installation
BuddyPress can make use of your existing bbPress install. Just provide the location of your bb-config.php file, and BuddyPress will do the rest

Input bb-config.php file location:
e.g. directory /home/yoursite/public_html/bb-config.php
Internal bbPress installation is a success when you get the message:
Forums were set up correctly using your existing bbPress install!
BuddyPress will now use its internal copy of bbPress to run the forums in your site. If you wish, you can remove your old bbPress installation files, as long as you keep the bb-config.php file in the same location.

Profile Field Setup
Your users will distinguish themselves through their profile page. You must give them profile fields that allow them to describe themselves in a way that is relevant to the theme of your social network.
Note: Any fields in the first group will appear on the signup page.

Backing Up Your Database and Files

Backing Up Your Database and Files

Codex Home → Getting Started → Frequently Asked Questions → Backing Up Your Database and Files
Backing Up Your Database and Files

Backing up your database and site files on a regular basis is one of the best practices to maintain your site. Backups of the database as well as the site』s folders and files in the server are essential to recover from a disaster such as hardware failure or if your site is compromised.
There are a number of approaches you may take to backup:
Hosting control panels
If your site』s hosting provides a control panel e.g Cpanel, Plesk, or Helm, then you should have backup available as a selectable option. Log in to your control panel, locate the item, review it』s options and enable it; generally it will backup both your site files and database and it will do this as a scheduled task which also rotates the backup i.e after a certain number of backups the task will then create the next set of backups and overwrite the first ones made, this way you have backups that will cover a certain period, typically this might be a week worth, so from any given day you should have backups that cover the previous six days.
With 『Rotating』 backups it』s worth bearing in mind that they dictate a window of opportunity in which you may recover or restore files in case of problems and as such, you need to keep a close eye on your site on a regular basis during the period your backup covers before being rotated. For example, if you have a problem on a Tuesday you have only Monday』s backup to revert to if you haven』t noticed the issue by the time next Monday comes around the good backup will be overwritten and you have lost the opportunity.
Manual Database backups
If you have a tool such as phpMyAdmin made available to you, you might choose to take a manual backup of a site』s database to download and store off site which is the recomended practice. Keeping backups in the same hardware they were taken from negates the usefulness of backups in the event of hardware failure.
A full database backup will pretty much help you recover your site in almost its entirety. For complete recovery, you』d also need to backup or download your site』s files and folders from the server. These static files includes uploaded media like images, PDFs, and other documents which you attached to your Posts/Pages.
The procedure for making a manual database backup has been well documented in the WordPress Codex: codex.wordpress.org/Backing_Up_Your_Database
WordPress Admin Dashboard / Backend Export
WordPress provides a means of exporting your posts, pages, comments, custom fields, categories, and tags.
Navigate to admin menu 『Tools > Export』 option and select all that you want to export. Save the exported file off site. Caveat: this is not a replacement for a full backup regimen, it only backups content which does not include database information on the site configuration. This method is best viewed as a quick means of restoring a few posts that may have been lost and can』t be recovered from the posts revisions table. Under the principle outlined below that one can』t be too safe, it is advisable to use this facility from time to time. **Note this method does NOT export your BuddyPress data, but only WordPress blog entries, comments and users
VaultPress
Update: VaultPress is owned by Automattic. As of Version 1.0+, it supports normal BuddyPress installations.
For complete peace of mind it may be worth considering the monthly subscription to the VaultPress service which continually monitors and backs up your site, files and database, and allows very simple restores in the event of a disaster. This provides a level of security and comfort worth every penny. See: VaultPress Features | VaultPress Plans
Backup often – be safe, not sorry
Generally there is no such thing as too many backups. It』s very easy to think that you have covered the process and are safe but it is good practice to keep multiple backups that cover the same data and keep them in different locations. If possible, download your site』s folder and files via s/ftp to your localhost machine, copy those files to a secondary devise such as usb drive, NAS drive, pen drive, etc. Do the same with your database backups … keep multiple copies of them on iifferent storage locations where possible.

默认主题更改日志

默认主题更改日志

Codex Home → Legacy Docs → Archived Section: Theme Development → The BuddyPress Default Theme → Default Theme Changelog
Default Theme Changelog

Archived file. Good up to BP 1.5 version

v1.5
A lot of new features.  To read about them, view the 「Highlights」 section on the 1.5 release page.
For those upgrading their theme to BuddyPress 1.5, please read the issues and solutions listed here:
https://codex.buddypress.org/releases/1-5-developer-and-designer-information/#theme
v1.2.9

jQuery 1.6.1 fixes for WordPress 3.2
jQuery Easing Plugin updated to 1.3
jQuery bgiframe.js updated to 2.1.2

To view which files were changed, please view the following link: https://buddypress.trac.wordpress.org/changeset?old_path=%2Ftags%2F1.2.8/bp-themes/&old=4619&new_path=%2Ftags%2F1.2.9/bp-themes&new=4619
v1.2.8

No changes!

v1.2.7

(Altered) Changed tab index on form elements in sidebar.php
(Altered) Secondary avatars will now not be generated for blog activity stream entries.

For a full list of changes, please view the following link: (https://buddypress.trac.wordpress.org/changeset?new=3422%40branches/1.2/bp-themes/bp-default&old=3407%40branches/1.2/bp-themes/bp-default — tbc)
v1.2.6

(New) Secondary avatars in the activity stream

To remove them, read this thread.

(New) Introduction of 「BP_Button」 class

This removes all hard-coded instances of the 「generic-button」 links in the theme
If you made changes to any of the following files in your theme, please make revisions as needed:

/members/single/member-header.php
/members/members-loop.php
/groups/groups-loop.php

(New) Ability to remove a member from a group (not ban)
(New) Pagination at the botton of all directory pages
(New) Miscellaneous new actions (see full list of changes linked below)
(Altered) Activity commenting CSS styles
(Altered) Javascript translation strings
(Altered) Zebra striping for tables
(Altered) Comment number count on blog posts
(Altered) Deprecate is_site_admin() function calls ( now uses is_super_admin() )

For a full list of changes, please view the following link:
https://buddypress.trac.wordpress.org/changeset?new=3296%40branches%2F1.2%2Fbp-themes%2Fbp-default&old=3124%40branches%2F1.2%2Fbp-themes%2Fbp-default

嵌入 (Embeds)

嵌入 (Embeds)

Codex Home → Getting Started → Embeds
Embeds

Since BuddyPress 1.5, we have integrated WordPress』 native Embeds functionality.
So now it』s easy to embed videos, images, and other content into your Activity Stream, Group Forum, and Private Message posts.
All you have to do is add your embed URL on its own line in the textarea.
eg.
This is awesome!
http://www.youtube.com/watch?v=ROBmgYcIBww
And your content will be automatically embedded!

Frequently Asked Questions
What sites are supported?
See https://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F
To embed more sites, you can use any oEmbed plugin for WordPress.
Embedly is a popular choice that supports over 200 sites. For performance issues when using Embedly, select only the sites you need to support.
How do I adjust the width of my embedded items?
If you』re not using the BuddyPress Default theme, you will probably want to customize the width of your embedded items so they match the width of your theme.
There are two ways to resize the width:

Set the 「maximum embed size」 in the WP Media Settings Subpanel
Set the $content_width variable in your theme』s functions.php:
if ( ! isset( $content_width ) )
// Change 640 to whatever the width of your column is
$content_width = 640;

Filtering embeds
BP doesn』t use the WordPress embed_oembed_html filter, but bp_embed_oembed_html can be used instead. For example:
add_filter( 'bp_embed_oembed_html', function( $html, $url, $attr, $rawattr ) {
// Wrap the embed with a

tag.
$html = '

' . $html . '

';
return $html;
}, 10, 4 );

I』m a developer. How can I find out more about WordPress Embeds?
Read the WordPress codex article:
https://codex.wordpress.org/Embeds#How_Can_I_Add_Support_For_More_Websites.3F
My YouTube video URL doesn』t show up! Why?
If the author of the YouTube video has disallowed embedding, due to privacy reasons, the video will not be embedded.

BP_ENABLE_MULTIBLOG

BP_ENABLE_MULTIBLOG

Codex Home → Getting Started → Customizing → BP_ENABLE_MULTIBLOG
BP_ENABLE_MULTIBLOG

This page is incomplete or needs checking and verifying or updating.

BP_ENABLE_MULTIBLOG is a BuddyPress constant that, when defined as true, allows your BuddyPress content to be displayed on any site in your WordPress Multisite network.
By default, BP_ENABLE_MULTIBLOG is disabled.
Description
On a normal BuddyPress installation (with BP_ENABLE_MULTIBLOG disabled), BuddyPress content – groups, profiles, etc – can only be viewed on the 「root blog」. So, for example, your BuddyPress profile is, by default, located at a URL that looks like this:
http://example.com/members/boonebgorges/
and it is displayed using the BuddyPress theme powering your root blog at http://example.com/. This is true even if you allow users to create subdomain or subdirectory blogs, such as http://boone.example.com/ or http://example.com/boone/ – links to BuddyPress content, such as those that appear in your BuddyBar or WP toolbar, will always point back toward the root blog.
With BP_ENABLE_MULTIBLOG enabled, BuddyPress content will be displayable on any site in your network, and BP links will always point to the current site. Thus,
on http://boone.example.com/, profile links will point to http://boone.example.com/members/boonebgorges/
on http://example.com/boone/, profile links will point to http://example.com/boone/members/boonebgorges/
on http://example.com/, profile links will point to http://example.com/members/boonebgorges
and so forth.
Usage
To turn on BP_ENABLE_MULTIBLOG mode, put the following line in your wp-config.php file, somewhere above 「That』s all, stop editing!」:
define( 'BP_ENABLE_MULTIBLOG', true );
Some warnings about BP_ENABLE_MULTIBLOG
BP_ENABLE_MULTIBLOG is not appropriate for most situations, and you should be sure to understand its limitations carefully before enabling it.

Note that BP_ENABLE_MULTIBLOG is not the same thing as WordPress Multisite, and BP_ENABLE_MULTIBLOG is not necessary for your users to have their own sites/blogs.
BP_ENABLE_MULTIBLOG does not enable separate BuddyPress networks on your installation. While it will be possible to view boonebgorges』s profile at more than one URL, the profile data itself (and group data, etc) will be the same on each site in your network. For multi-network BuddyPress, see https://wordpress.org/extend/plugins/bp-multi-network/.

Example use case
Enabling BuddyPress content to be displayable on any site in your network can be useful when supporting multilingual versions of your site.
If your setup has a separate site for each language, then setting BP_ENABLE_MULTIBLOG to true allows you to access the BuddyPress pages in each language, e.g.:
http://mysite.com/members
http://french.mysite.com/members
http://spanish.mysite.com/members
http://german.mysite.com/members
Using a separate site for each language is one of the common approaches to multilingual web sites.  In the WordPress specific world, it』s the approach that』s adopted by the Multilingual Press plugin https://wordpress.org/plugins/multilingual-press/.
[Note: a future challenge is how to handle multisite networks, where we want to allow some sites to support BuddyPress pages, but disable support on other sites in the network.  As well as underlying implementation, 『Super Admin』 controls to manage this would be useful.]