Replies
Hello Dandy,
Please let me know which version of BudddyPress you are using.
Thank You
RaviHi Dandy,
Please replace the old code with the following code and let me know if it works or not.
add_action( 'bp_setup_nav', 'buddydev_setup_modified_nav', 20 ); function buddydev_setup_modified_nav() { $bp = buddypress(); bp_core_remove_subnav_item( buddypress()->activity->id, 'just-me' ); $bp->members->nav->{'activity/mentions'}->position = 40; $bp->members->nav->{'activity/favorites'}->position = 30; if ( bp_is_active('groups') ) { $bp->members->nav->{'activity/groups'}->position = 20; } if ( bp_is_active('friends') ) { $bp->members->nav->{'activity/friends'}->position = 10; } bp_core_new_nav_item( array( 'name' => __('Home','buddypress'), //replace with your name 'slug' => 'home', // slug must be unique 'screen_function' => 'buddydev_show_activity', 'position' => 1, // unique 'default_subnav_slug' => false, 'show_for_displayed_user' => true, //Whether the nav item should be visible when viewing a member profile other than your own ) ); bp_core_new_nav_default ( array( 'parent_slug' => buddypress()->activity->id, 'subnav_slug' => 'friends', 'screen_function' => 'bp_activity_screen_friends' ) ); if ( bp_displayed_user_domain() ) { $user_domain = bp_displayed_user_domain(); } elseif ( bp_loggedin_user_domain() ) { $user_domain = bp_loggedin_user_domain(); } else { return; } $parent_slug = bp_get_profile_slug(); $slug = trailingslashit( $user_domain . $parent_slug ); bp_core_new_subnav_item( array( 'name' => __( 'Personal' ), 'slug' => 'just-me', 'parent_slug' => $parent_slug, 'parent_url' => $slug, 'position' => 0, 'screen_function' => 'buddydev_show_activity' )); } function buddydev_show_activity() { add_action( 'bp_template_content', 'buddydev_render_screen_my_activity' ); bp_core_load_template( 'members/single/plugins' ); } function buddydev_render_screen_my_activity() { ?> <div class="item-list-tabs no-ajax" id="subnav" role="navigation"> <ul> <li id="activity-filter-select" class="last"> <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label> <select id="activity-filter-by"> <option value="-1"><?php _e( '— Everything —', 'buddypress' ); ?></option> <?php bp_activity_show_filters(); ?> <?php /** * Fires inside the select input for member activity filter options. * * @since 1.2.0 */ do_action( 'bp_member_activity_filter_options' ); ?> </select> </li> </ul> </div><!-- .item-list-tabs --> <?php if( is_user_logged_in() && bp_is_my_profile() ) { bp_get_template_part( 'activity/post-form' ); } echo "<div class='activity'>"; bp_get_template_part( 'activity/activity-loop' ); echo "</div>"; }
Thank You
RaviHi Dandy,
Please place the following code in your bp-custom.php file and let me know if It is working or not.
function buddydev_setup_modified_nav() { bp_core_remove_subnav_item( buddypress()->activity->id, 'just-me' ); bp_core_new_nav_default ( array( 'parent_slug' => buddypress()->activity->id, 'subnav_slug' => 'mentions', 'screen_function' => 'bp_activity_screen_mentions' ) ); if ( bp_displayed_user_domain() ) { $user_domain = bp_displayed_user_domain(); } elseif ( bp_loggedin_user_domain() ) { $user_domain = bp_loggedin_user_domain(); } else { return; } $parent_slug = bp_get_profile_slug(); $slug = trailingslashit( $user_domain . $parent_slug ); bp_core_new_subnav_item( array( 'name' => __( 'Personal' ), 'slug' => 'just-me', 'parent_slug' => $parent_slug, 'parent_url' => $slug, 'position' => 0, 'screen_function' => 'buddydev_show_activity' )); } add_action( 'bp_setup_nav', 'buddydev_setup_modified_nav', 20 ); function buddydev_show_activity() { add_action( 'bp_template_content', 'buddydev_render_screen_my_activity' ); bp_core_load_template( 'members/single/plugins' ); } function buddydev_render_screen_my_activity() { ?> <div class="item-list-tabs no-ajax" id="subnav" role="navigation"> <ul> <li id="activity-filter-select" class="last"> <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label> <select id="activity-filter-by"> <option value="-1"><?php _e( '— Everything —', 'buddypress' ); ?></option> <?php bp_activity_show_filters(); ?> <?php /** * Fires inside the select input for member activity filter options. * * @since 1.2.0 */ do_action( 'bp_member_activity_filter_options' ); ?> </select> </li> </ul> </div><!-- .item-list-tabs --> <?php if( is_user_logged_in() && bp_is_my_profile() ) { bp_get_template_part( 'activity/post-form' ); } echo "<div class='activity'>"; bp_get_template_part( 'activity/activity-loop' ); echo "</div>"; }
For hiding specific tab use buddypress function “bp_core_remove_subnav_item()” as I have used to remove the menu.
Make sure the tab You want to remove should not be default tab of its parent. If it is a default nav than you have to register new default tab of that menu for that you can refer the following linkhttps://buddydev.com/buddypress/changing-default-subnav-buddypress-component/
Thank you
RaviHi Marco,
Sorry for the inconvenience.
if deactivation of the plugin is not resolving the problem then it is probably another plugin causing the problem. Please follow the step to find the culprit.1. Disable all other plugins except BuddyPress and check if the issue still persists or not.
2. If it is working, try enabling other plugins one by one and check the bug.Did you find the issue?
Thank You
RaviHi Mike,
You have to create in your current theme. You have to create Folder like first folder with name ‘mediapress’ into this folder create another folder one with name “default” then folder with name “widget and copy the “grid-photo.php” into it and modify it.
Thank You
Ravi- Ravi on July 25, 2016 at 8:30 pm in reply to: Want to create location based search for members in buddypress #4784
Hi Vineeta,
Welcome to BuddyDev Forum. Please explain me bit more. Tell me what exactly you want.
1. Will it be a simple text based search to find the members under a particular location. If Yes it can be done easily.
2. Will it be a search based on location such as geo location to find out the member with in the certain range. If yes then it would be a strategical job and will take time.Please let me know. What exactly your requirement is?.
Thank You
Ravi Hi Mike,
Thank you for posting here. You need to modify the template file file. Just follow the steps below
Step 1: Copy the template file to the theme folder following will be the expected file url
From
“wp-content/plugins/mediapress/templates/mediapress/default/widgets/grid-photo.php”To
“wp-content/themes/current-theme/mediapress/default/widgets/grid-photo.php”Step 2: modify the following section of the template
<div class="<?php mpp_media_class( 'mpp-widget-item mpp-widget-photo-item '. mpp_get_grid_column_class( 1 ) );?>">
to
<div class="<?php mpp_media_class( 'mpp-widget-item mpp-widget-photo-item '. mpp_get_grid_column_class( 2 ) );?>">
it will build the the two column layout. Please let me know it it works or not.
Thank You
RaviHi Lavish,
I have checked this code in current theme functions file and working fine for me.
Notification will receive by user in the following case
1. User mentioning is Super Admin.
2. User mentioning to Super Admin.
3. User is a friendNo notification will receive in any other case
Thank You
RaviHi Lavish,
Try the following code in your bp-custom.php file and let me know if it works or not.
add_filter( 'bp_activity_at_name_do_notifications', 'buddydev_disable_bulk_public_message', 10, 4 ); function buddydev_disable_bulk_public_message( $do_disable, $usernames, $user_id, $activity ) { //if the logged in or the mentioned user is super admin, let the message go, else not if ( is_super_admin() || is_super_admin( $user_id ) ) { return $do_disable; } elseif ( function_exists( 'friends_check_friendship' ) && friends_check_friendship( $user_id, bp_loggedin_user_id() ) ) { return $do_disable; } return false; }
Thank You
Ravi