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.
默认主题更改日志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
空白页Codex Home → Getting Started → Troubleshooting → Blank Pages
Blank Pages
In some server environments, installation of BuddyPress can lead to blank pages. A great source for troubleshooting this problem is the error logs.
Memory Limit
Increasing the available memory may fix the blank page problem. Three methods are available for increasing the memory limit.
php.ini
If possible, increase the memory limit within the php.ini file.
wp-config.php
If possible, increase the memory limit in the wp-config.php file by adding define ('WP_MEMORY_LIMIT', '64M');.
.htaccess
If possible, add the following to the .htaccess file: php_value memory_limit 256M
talk to your host
If you cannot resolve increasing memory with the fixes above, it means that your hosting provider prevents increases in memory limits. Contact tech support right away. Some hosting providers might require you to upgrade your plan or pay extra.
Clear your browser cache or try another browser
After increasing memory, be sure to clear your browser cache. Also, troubleshoot multiple browsers and multiple user roles (subscriber, author, admin, etc.)
Database Tables
Other things stopping the DB tables being run is some sort of warning or error with PHP – often either a memory limit, CPU limitation, a problem with the web server itself, bad code or corrupt file.
1) Memory limit problem often reveals itself with 「failed to allocate」 in the apache/php error logs.
2) People have had mixed success running WPMU/BP on virtual hosted servers; I suppose it depends on the company you are using. If such an outside influence stopped activity *part way* through the BuddyPress installation, then you』d end up with a corrupt install. As a rule of thumb, avoid virtual hosted servers for WPMU/BP.
3) I』m a *unix man as far as web servers go, so I can』t talk for Windows. If you see 「segfault」 errors in WPMU/BP for Apache (or similar), you』ve probably got a library or versioning conflict — i.e. incompatibility between specific versions of PHP and MySQL, for example. These are really tricky to figure out what』s causing the problem, but if you』ve recently installed a new version of your web server/mysql/php etc, this could be why.
4) Bad code or corrupt file – how is everyone in this thread installing BuddyPress? Via the automatic plugin installer? If so, try to FTP files up to your server – or better yet, SSH and use a shell to install the files yourself.
Source
XAMP and MAMP
Testing servers built with XAMP or MAMP should use the latest versions.
头像上传失败Codex Home → Getting Started → Troubleshooting → Avatar upload fails
Avatar upload fails
There could be a number of reasons uploads would fail, your server error logs may provide a clue as to what has happened.
The predominant reason uploads fail is due to the server being unable to write to the uploads directory, the 『server』 in this instance is the server process that is running your web server and on *nix boxes is generally 『httpd』 or 『Apache』 this process and it』s 『group』 or 『owner』 must have access to the sites folder structure.
When uploads such as Avatars do fail establish whether this is a general uploads failure by attempting to upload an image via the WordPress Media library interface, more often than not this, too, will fail and you will know it』s an owner/permissions failure that needs correcting – you may need to contact your host to have this corrected explaining that the server process can』t write to your site directories, specifically 『uploads』.
Another important factor is that the PHP image manipulation extension must be installed, make sure you have the 『GD image library』 installed by checking your phpinfo stats – usually available if you have control panel installed if not you would need to upload a file to your site root with the single command in and navigate your browser to that file to see all your PHP configuration detail. Remember to remove that file from your site root after you』ve copied the details for reference.
Next, check permissions, so make sure the web server has correct permissions.
/wp-content/uploads should be set to 755 on a Unix server.
On this matter you may see advice along the lines of setting permissions to 『777』 or 『world writeable』. This is bad advice. Changing permissions to 『777』 may overcome the problem but there is never a case where any folders need completely open permissions; it』s very insecure.
插件兼容性 – BP 1.5Codex Home → Legacy Docs → Archived Section: Plugin Development → Plugin Compatibility – BP 1.5
Plugin Compatibility – BP 1.5
Archived file. Good up to BP 1.5 version
This list is a community volunteer effort to check compatibility of the majority of publicly available BuddyPress plugins against BuddyPress 1.5. Even if a plugin is marked as not fully working, most plugins will eventually be updated by their authors, but please be patient. If you know of a plugin that works with BuddyPress 1.5, or doesn』t, please contribute to this forum discussion.
If you』re a plugin author, the BuddyPress Media plugin team has put together a wiki showing developers how to make their plugin compatible with BuddyPress 1.5.
PASS
FAIL
UNKNOWN
开发者和设计师信息 BP 1.5Codex Home → Legacy Docs → Archived Section: Getting Started → Developer and Designer Information BP 1.5
Developer and Designer Information BP 1.5
Archived file. Good up to BP 1.5 version
As with any release developers and designers may need extra information so here is a collection of links around the new release.
BuddyPress 1.5.2 and WordPress 3.3
Use wp_enqueue_scripts, not wp_print_styles, to enqueue scripts and styles for the frontend
BuddyPress 1.5 and WordPress 3.2.1
Plugin update information : Boone B Gorges
Better Metadata wrappers : Boone B Gorges
Accessing User metadata : Boone B Gorges
Does your BuddyPress plugin or theme modify BP』s navigation menus? : Boone B Gorges
Maintain Backward Compatibility with an abstraction file: Boone B Gorges
Custom Post Types Comments and the Activity Stream in bp 1.5 : Boone B Gorges
Manually modifying single group navigation in BuddyPres 1.5 : Boone B Gorges
Fix your older plugin to be compatible with BP 1.5: BuddyPress Media Dev team
Theme information:
Member settings pages are blank
BuddyPress 1.5 comes with brand-new templates so you can style your member settings pages. However, if you』re using an older child theme, you will need to copy over these templates to your WP theme.
To fix this problem, copy over the following folder:
?1/plugins/buddypress/bp-themes/bp-default/members/single/settings/
directly to your WP theme』s folder.
Member forum pages are blank
BuddyPress 1.5 ships with a brand new member sub-nav item called 「Forums」 where members can find the topics they have started or replied to.
Example:
http://testbp.org/members/johnjamesjacoby/forums
For this to function properly in older child themes, you』ll need to copy over the following files and folders:
?12/plugins/buddypress/bp-themes/bp-default/members/single/forums.php/plugins/buddypress/bp-themes/bp-default/members/single/forums/
directly to your WP theme』s folder.
You』ll also need to modify the following file in your WP theme:
?1/wp-content/themes/YOUR-THEME/members/single/home.php
Open up /members/single/home.php in your editor and after:
?12
Add:
?12
Activity entries are missing the 「Delete」 button
BuddyPress 1.5 changed the way the 「Delete」 button is rendered in activity entry items.
In older child themes, you will need to modify the activity entry template located in:
?1/wp-content/themes/YOUR-THEME/activity/entry.php
Open up entry.php and add the following snippet:
?1
Above or below:
?1
Now you can delete activity entries again!
Group avatar uploading doesn』t work
BuddyPress 1.5 changed a bit of code in the group creation template that broke compatibility with older themes.
For compatibility, you will need to modify the group creation template located in:
?1/wp-content/themes/YOUR-THEME/groups/create.php
Open up create.php and find the following snippet:
?1
And replace it with:
?1
You should now be able to upload group avatars again!
Avatar uploading doesn』t work on the registration page
In BuddyPress 1.5, the ability to upload an avatar was removed from the registration page.
In older child themes, you should remove a section of code in the registration template located in:
?1/wp-content/themes/YOUR-THEME/registration/register.php
Open up register.php and remove the following block of code:
?1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
<input type="submit" name="upload" id="upload" value="" /> <input type="hidden" name="signup_email" id="signup_email" value="" /> <input type="hidden" name="signup_username" id="signup_username" value="" />
<img src="" id="avatar-to-crop" class="avatar" alt="" />
<img src="" id="avatar-crop-preview" class="avatar" alt="" />
<input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="" /> <input type="hidden" name="signup_email" id="signup_email" value="" /> <input type="hidden" name="signup_username" id="signup_username" value="" /> <input type="hidden" name="signup_avatar_dir" id="signup_avatar_dir" value="" /> <input type="hidden" name="image_src" id="image_src" value="" />
Stylesheet changes
BuddyPress Default uses a function to enqueue it』s stylesheets in BuddyPress 1.5. Our 「Building a Child Theme」 codex article has been updated for BP 1.5 and reflects the information posted below.
The function you want to be interested in is this:
?1234567891011121314151617181920if ( !function_exists( 'bp_dtheme_enqueue_styles' ) ) :/** * Enqueue theme CSS safely * * @see https://codex.wordpress.org/Function_Reference/wp_enqueue_style * @since 1.5 */function bp_dtheme_enqueue_styles() { // Bump this when changes are made to bust cache $version = '20110804'; // Default CSS wp_enqueue_style( 'bp-default-main', get_template_directory_uri() . '/_inc/css/default.css', array(), $version ); // Right to left CSS if ( is_rtl() ) wp_enqueue_style( 'bp-default-main-rtl', get_template_directory_uri() . '/_inc/css/default-rtl.css', array( 'bp-default-main' ), $version );}add_action( 'wp_enqueue_scripts', 'bp_dtheme_enqueue_styles' );endif;
All you need to do is declare that in your child theme as it has a check to see if exists it will then use your function so no need to deregister.
In your functions.php declare the function like this:
?123456789101112function bp_dtheme_enqueue_styles() { // Bump this when changes are made to bust cache $version = '20110804'; // Default CSS wp_enqueue_style( 'bp-default-main', get_template_directory_uri() . '/_inc/css/default.css', array(), $version ); // Right to left CSS if ( is_rtl() ) wp_enqueue_style( 'bp-default-main-rtl', get_template_directory_uri() . '/_inc/css/default-rtl.css', array( 'bp-default-main' ), $version );}add_action( 'wp_enqueue_scripts', 'bp_dtheme_enqueue_styles' );
If you want no styles enqueued you can just call it empty like this:
?12345
Alternatively if you anted to add in your own styles you can simply enqueue them after the default or even instead of the default.
You can also do the same for scripting and other functions in the BuddyPress Default』s functions.php.
BuddyPress Template Pack Tutorials for BP 1.5
Twenty Eleven theme – https://codex.buddypress.org/theme-development/theme-dev-bp-template-pack-walkthrough-twenty-eleven-bp-1-5/ by mercime
Twenty Ten Theme – https://codex.buddypress.org/theme-development/theme-dev-bp-template-pack-walkthrough-twenty-ten-bp-1-5/ by mercime