Did you try following the instructions?
- Paste in your theme functions.php
- Load the site in a browser
- Then REMOVE this function from your theme functions.php
/*
* Paste in your theme functions.php or in bp-custom.php.
* Load the site in a browser
* Then REMOVE this function from your theme functions.php or bp-custom.php.
*/
function buddypress_add_last_activity() {
$members = get_users( 'fields=ID' );
// $members = get_users( 'fields=ID&role=subscriber' );
foreach ( $members as $user_id ) {
bp_update_user_last_activity( $user_id, bp_core_current_time() );
}
}
add_action('bp_init', 'buddypress_add_last_activity' );
1. set up a child theme.
2. inside the childtheme directory there will be a functions.php file.
3. place your custom code in there.
Hi Venutius,
hmmm … meanwhile I tried to figure the file you suggested; Under the theme files, I foud the “function.php” – file (screenshot: https://ibb.co/YDw7LN5). But there’s no buddypress menu, where I could add this code snipped. Maybe I’m totally wrong here! Please, could you be more precise, so I could follow your advise?
thank you very much in advance and best Regards!
You should add customisations either in your themes function.php or in a bp-custom.php file placed in the plugins directory.
I am new to Buddypress and there is a question. I have created a wordpress site and wanted this to became a membership/club site. I use a theme named Astra and tried to style special Theme styles like header with background image etc. But if i tried it on Buddypress pages (Aktivity for eg) i failed. What i am doing wrong
I’d first try switching your BuddyPress theme to BP Legacy in Settings>>BuddyPress>>Options. and see if the menu appears
Thank you Venutius,
i have done some customizations to the theme header but nothing to the theme body, it i still white. I am also not on 2019 and would really like to keep the theme i have as its a good one, if possible.
There are only two customizations done to the theme php, one is to increase the upload size and the other to enable visual editor in bbpress.
If you feel that the fonts might be white, is there a way to change the color by adding a code? Or any other resolution other than changing themes? I would like to keep that as last resort. However what i am going to do is change it for testing purposes and report back to you.
Ahh! I think I know what it is, but it’s not the theme – tried 2019 and as ugly as it displays, still stuck in center.
Okay, let me tell you, it’s the widget I’m using to place it in a certain place on a page (amr shortcode any widget). The shortcode is: [do_widget id=bp_messages_sitewide_notices_widget-2]
So, i used your CSS and tinkered it a little:
#bp_messages_sitewide_notices_widget-2 strong {
text-align: left !important;
}
But, believe it or not, the title (the part i wanted to keep center) is the only thing that goes left, body text still center. – getting so close!, But how to switch that?
Both should be displayed on the left, if they are being centered then I think you have something that is affecting the CSS for these already. Do they still center with a default theme such as 2017 loaded?
One issue I came across recently was the theme was hiding the user profile fields by printing them with the colour white with a white background. So my first suggestion would be to switch themes to a default theme such as 2017.
Have you done any customisations that could affect this?
This one is not that straight-forward there is a filter you can use as follows:
function bpex_role_disable_avatar_uploads( $default ) {
$user = wp_get_current_user();
$user_roles_array = $user->roles ? $user->roles : array();
foreach ( $user_roles_array as $key => $role ) {
if ( $role == 'subscriber' ) {
$default = true;
}
}
return $default;
}
add_filter( 'bp_disable_avatar_uploads', 'bpex_role_disable_avatar_uploads' );
However this causes BuddyPress to simply show the user that they can upload their profile image via gravatar, and I’m afraid you can’t switch this off.
So the alternative is to remove the Change Photo tab and admin-bar menu item:
add_action( 'bp_setup_nav', 'bpex_remove_change_profile_photo_tab', 50 );
add_action( 'bp_setup_admin_bar', 'bpex_admin_bar_remove_change_profile_photo', 50 );
function bpex_remove_change_profile_photo_tab() {
if ( ! bp_is_user_profile() && ! bp_is_user_activity() && ! bp_is_user() && bp_displayed_user_id() != wp_get_current_user() ) {
return;
}
$user = wp_get_current_user();
$user_roles_array = $user->roles ? $user->roles : array();
foreach ( $user_roles_array as $key => $role ) {
if ( $role == 'subscriber' ) {
bp_core_remove_subnav_item( 'profile', 'change-avatar' );
}
}
}
function bpex_admin_bar_remove_change_profile_photo() {
global $wp_admin_bar, $bp;
if ( ! bp_use_wp_admin_bar() || defined( 'DOING_AJAX' ) ) {
return false;
}
$user_id = get_current_user_id();
if ( ! $user_id || $user_id == 0 || ! is_numeric( $user_id ) ) {
return;
}
$user = wp_get_current_user();
$user_roles_array = $user->roles ? $user->roles : array();
foreach ( $user_roles_array as $key => $role ) {
if ( $role == 'subscriber' ) {
$wp_admin_bar->remove_menu( 'my-account-xprofile-change-avatar', 'my-account-xprrofile' );
}
}
}
You’d need to put this in your child themes functions.php or a bp-custom.php file in the plugins directory.
Hi Debby, I found time to test this, if you install WP Featherlight and then make the following change:
<?php $fullsize_avatar_url = bp_core_fetch_avatar( array( 'type' => 'full', 'html' => false, 'no_grav' => true, 'item_id' => bp_get_member_user_id() ) ); ?>
<li <?php bp_member_class(); ?>>
<div class="item-avatar">
<a href="#" data-featherlight="<?php echo $fullsize_avatar_url; ?>"><?php bp_member_avatar(); ?></a>
</div>
You will have your avatars in lightboxes. However these will probably be small. The default is only 150 pixels.
You can change this with the following setting placed in either your child themes functions.php or a bp-custom.php placed in the plugins directory.
define ( 'BP_AVATAR_FULL_WIDTH', 150 );
define ( 'BP_AVATAR_FULL_HEIGHT', 150 );
change the 150 to your preferred pixel size for the image.
Now I flipped the navigation from vertical to horizontal all the links appeared, so it was a problem with my theme I guess π All my fault sorry.
Thank you once again and have a nice day π
Hi there, some answers:
1. You can change the layout of profiles by overloading the profile files and css, see: https://codex.buddypress.org/themes/theme-compatibility-1-7/theme-compatibility-2/ it’s possibly a bit advanced for you right now but all the files in the plugins/buddypress/bp-templates/your-bp-theme/buddypress can be copied, modified and loaded from your child theme directory. Similarly you can overload the css to make styling and layout changes.
1b. The default is for horizontal navigation unless you’ve changed it in Customizer>>BuddyPress.
2. The BuddyPress extended profile is editable from the front end, and avatar too. It’s only the wordpress profile that’s enditable in admin and most BP sites don’t use that as t’s really set up for authors.
3. I recently posted the code to combine all the profile activity feeds into 1, https://buddypress.org/support/topic/how-to-combine-activity-tabs-to-one/
4. https://wordpress.org/plugins/cb-change-mail-sender/
5+6 are bbPress questions, for the best answer you should post on their forum https://bbpress.org/forums/
7. Assuming you have set up the groups directory page and enabled group creation by users in Settings>>BuddyPress>>Options, users will have the option to create groups on the Groups directory page and also from the Groups menu of the WordPress toolbar ( top right hand side of the screen, hover over your avatar image, drop down will appear one option will be groups.
Which buddypress_functions.php file are you talking about? I’d have thought you’d put it in your themes functions.php file or a bp-custom.php file located in the plugins directory.
Also I’d load it in the action hook ‘bp_setup_nav’, not ‘wp’.
WP 5.1.1 and BP 4.2.0 Theme: Catch Box
My adminbar disapears when I go to the notification and settingspage – is it supposed to do that?
Hi,
We’re working on launching a new membership site.
Themes: Boss / SocialLearner
Other main plugins:
BuddyPress (Version 4.2.0)
bbPress (Version 2.5.14)
LearnDash (Version 2.6.4)
Memberium (Version 2.84)
We migrated users into WordPress via the Rest API from another system.
I noticed that the nickname on the Extended Profile is being deleted and being copied over into the First Name field when we switch from the Extended Profile tab to the Profile tab when viewing the User in the WP Admin dashboard.
Here are the steps:
1. Open user’s Extended profile in new tab
2. Set Nickname and hit update, then verify it saved.
3. Click on the Profile tab.
4. Now the Nickname is overwritten in the First Name field (which it should not) and saved in the Nickname field on the Profile tab.
5. Click back to the Extended Profile tab.
6. Nickname is empty
7. Click back to the Profile tab
8. The original First Name is now visible in the First Name field and Nickname is still populated with the new nickname.
We can’t figure out what’s happening and need help please! Thank you for any assistance.
Hi Shanebp, π
Thank you for your response.
> On this page β¦/wp-admin/options-general.php
Is this option selected: Membership > Anyone can register
Yes, I did this: http://prntscr.com/nanirk
> Then, on this page β¦/wp-admin/admin.php?page=bp-page-settings
Did you assign the βRegisterβ page?
Yes, I did this also:
Pages: http://prntscr.com/nabvdy
I did switch the theme to WP theme and I did see the front-end defaults. So, if it is the Theme, what do I do?
Thanks Shanebp,
Christine π
I think it would be possible yes. If you look at plugins/buddypress/bp-templates/your bp theme/buddypress/members/members-loop.php for example, you can see the link for the members avatar being created for the members directory page.
Most lightboxes use a data tag to identify that the link is to open in a light box, so you could overload this file and replace the href with the link to the full size avatar and add the data tag as required.
You’d then need to add the Javascript for the lightbox, probably in a plugin and together that should work.
There’s nothing off the shelf that does this though.
However that would stop the current default of clicking on the avatar taking you to the members profile. That might be a problem for you but I guess you could simple add another button to visit the members profile.
Really? It must be a theme issue then?
Thanks
> I cannot see any of the default fields on the Registration page
On this page …/wp-admin/options-general.php
Is this option selected: Membership > Anyone can register
Then, on this page …/wp-admin/admin.php?page=bp-page-settings
Did you assign the ‘Register’ page?
Remember that you should not be able to see the register page if you are logged in.
If you still cannot see the fields:
What are the default fields that you expect to see?
Try switching themes momentarily to a WP theme like 2019 to see if the issue is related to your preferred theme.
Helloooo there BuddyPress! π π
I am new to BuddyPress and I am so excited to learn and use it.
Website: http://ceefworld.org/ – In development, it is not live yet.
Theme: Charity Is Hope: (https://themeforest.net/item/hope-nonprofit-charity-donations/18634753?s_rank=3)
WordPress version: 5.1.1
BuddyPress version: 4.2.0
I have installed BuddyPress and I cannot see any of the default fields on the Registration page or when a person is logged in I don’t see the defaults fields there either, where the can edit their profile or anything.
So, I guess what am I doing wrong? I set-up all settings I wanted but still don’t see them on the front end. What do I need to do?
Thank you for your support. I truly appreciate it,
Christine π
Did you also try the standard debugging steps?
- check your browser’s console
- turn on WP_DEBUG and check the logs
- switch themes momentarily
- remove bp-custom.php
The database is for data, not code.
There may be a ‘bad’ setting in the options table, but you’ll have to find it; maybe something about avatars or BP.
No I was responding to what wp.com said about it being the theme that could be causing the issue.
Anyway, no we know you can see the BuddyPress Pages Setting and know how to assign your groups page buddypress, you can check to see if you get the groups directory to show.