Forum Replies Created
-
In reply to: Hide members from Members Directory
OK, I think I might have cracked it for you. Just tested and this works for me. Add this directly after
bp_the_member()in members-loop.php<?php $memberid = bp_get_member_user_id(); $now = time(); $last_active = bp_get_user_meta ( $memberid, 'last_activity', true ); $last_active = strtotime( $last_active ); $seconds_since_last_active = $now - $last_active; $minutes_since_last_active = $seconds_since_last_active / 60; $hours_since_last_active = $minutes_since_last_active / 60; $days_since_last_active = $hours_since_last_active / 24; if ( $days_since_last_active > 60 ) continue; ?>Basically, for each member, this will get the number of days since last active and if that number is greater than 60 then it will skip them (not display that member on the page).
In reply to: Hide members from Members DirectoryThe general idea would be to add something like this directly after
bp_the_member()in members-loop.php$days_since_last_login; if ( $days_since_last_login > 60 ) continue;You just need to find out how to get the number of days since last login.
In reply to: Amend Members Directory titlewill do! i’ll get started on it this weekend and post on Trac if I come across any issues.
In reply to: Amend Members Directory title@hnla i’m going to start using theme compat post 1.8 as i need the template hierarchy stuff you’ve been working on. Can’t wait for that!
In reply to: Amend Members Directory titleYou certainly don’t have to set up a localisation file if changing the odd heading in BuddyPress is all you need to do.
That said – The benefits of having a localisation file in place are huge (i can name some if you like..?) and it isn’t difficult to set one up if you follow the tutorial on that page.
Going back to your method of editing your theme’s files – try making the exact same change in file:
plugins/buddypress/bt-themes/bp-default/members/index.php
If that change works then you haven’t set up your child theme properly.
In reply to: [Resolved] Conditional check for activate pagethanks again @sbrajesh – i shouldn’t have assumed exiting was automatic!
In reply to: [Resolved] Conditional check for activate page@hnla you beat me to it – i was just reading that exact page. Thanks for your help!
In reply to: [Resolved] Conditional check for activate page@sbrajesh thank you! Adding
exit(0);nailed it!bp_is_current_component( ‘activate’ )and‘activate’ == bp_is_current_component()andbp_is_activation_page()andis_page('activate')all work by themselves – it was my function that was missing an exit statement that was the problem. Thanks to @sbrajesh it’s all sorted now.@sbrajesh i do wonder the reason for the exit statement? doesn’t the function get exited automatically? no real issue though as the problem is resolved.
The easiest way to inherit ‘some’ of the CSS from the default theme is to copy what you need and paste it into your theme’s style.css.
Then add this to your functions.php file
if ( !function_exists( 'bp_dtheme_enqueue_styles' ) ) : function bp_dtheme_enqueue_styles() {} endif;This will tell BuddyPress not to queue up the default stylesheet.
In reply to: Amend Members Directory titleInstead of editing the text strings in the core or you theme’s files, you can use a language translation file. It makes life much easier:
https://codex.buddypress.org/developer/customizing/customizing-labels-messages-and-urls/
In reply to: [Resolved] Conditional check for activate pageI am trying to redirect logged-in users away from the activate page if they try to access it. This is what I have which isn’t working
//redirect logged-in users away from activate page function bp_redirect_activate_to_profile() { global $bp; if ( is_user_logged_in() && bp_is_activation_page() ) { wp_redirect( $bp->loggedin_user->domain ); } } add_action('wp','bp_redirect_activate_to_profile');In reply to: [Resolved] Conditional check for activate pageHi @sbrajesh
Have you tested
bp_is_activation_page()recently? Both that andbp_is_current_component( 'activate' )don’t seem to be working for me even though similar functions such asbp_is_register_page()work perfectly.In reply to: Autosuggest in core?@djpaul I thought the members search also had the autosuggest feature?
In reply to: Help with homepage redirect to Profile PageYou don’t need to put any code in your homepage template. @bphelp’s code goes into your bp-custom.php file.
I am using a slightly different method. Copy and paste this into your theme’s functions.php file.
//redirect logged in users away from homepage to their profile page function bp_homepage_to_profile() { global $bp; if(is_user_logged_in() && bp_is_front_page()) { wp_redirect( $bp->loggedin_user->domain ); } } add_action('wp','bp_homepage_to_profile');In reply to: Help with homepage redirect to Profile Page@bphelp nice new blog! looking forward to hearing some tips and tricks…
In reply to: BuddyPress//Jigoshop issuesYou’ll need to post a link to your website and/or provide screenshots of the problem. It will likely be a CSS issue
I haven’t used this plugin but it looks as though it will do what you need:
In reply to: don't want registration page to show after loginThat code needs to go in your theme, replacing your current menu. It doesn’t go in functions.php. Try looking in header.php. you’re looking for wp_nav_menu
In reply to: don't want registration page to show after loginIt works for me on a menu I’ve called footer.
I reckon the 2 menu approach will be easier anyway . you’ll have to create another menu in wp admin but that should be straight forward just a little time consuming.
In reply to: Changing the avatar size on the Members pageif you want to make the avatar a bit bigger you could try
<?php bp_member_avatar( 'type=thumb&height=100&width=100' ); ?>In reply to: don't want registration page to show after loginWith reference to your code, you have
primary-navwhere you should haveMain-Menu. Also, don’t forget to log out when you check if the register link is in the menu. It’ll only be visible to logged-out usersIn reply to: don't want registration page to show after login@hnla actually suggested an easier option i almost overlooked. You could set up 2 menus in WP Admin and display them in your theme according to the logged-in status of the user:
<?php if ( is_user_logged_in() ) { wp_nav_menu( array( 'theme_location' => 'user-loggedin-menu' ) ); } else { wp_nav_menu( array( 'theme_location' => 'user-loggedout-menu' ) ); } ?>In reply to: Changing the avatar size on the Members pageAh OK.
Remove this bit
<?php bp_member_avatar( 'type=full&width=750&height=750' ); ?>and replace it with
<?php bp_member_avatar( 'type=thumb&height=30&width=30' ); ?>In reply to: don't want registration page to show after login@benjino use the last function i posted, making sure to replace CHANGE-THIS with the name of the menu you want to target. The name of the menu can be found in WP Admin, when you set-up the menu, you had to give it a name.
In reply to: don't want registration page to show after login@hnla I searched for the thread you mentioned which had the solution already posted. Can be found here:
https://buddypress.org/support/topic/adding-dynamic-profile-link-to-main-menu-item/