Tagged: buddypress, menu
Hello,
I don’t want to show admin bar menu to users. Question, is it possible to move the buddypress menu from Admin bar to sidebar
I’m not sure how it’s called but I meant this one:
https://www.google.com.ph/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwjmye_82fTMAhXH2KYKHfbdCtYQjBwIBA&url=http%3A%2F%2Fimg15.hostingpics.net%2Fpics%2F464334profil.png&psig=AFQjCNGtHejjtsQTp6jEn1IDVL-4cI4HNg&ust=1464240491187964Thank you in advance.
Hi MM,
Welcome to Buddydev. There are multiple ways to do it.Let us go with the easy ones.
1. You can use this function bp_get_loggedin_user_nav(). Please be warned that it has been marked as deprecated but it is not going anywhere soon.
2. Or, you can create a custom menu in the Dashboard->Menus and use links from BuddyPress link group(If not visible, see the screen options to enable it) and then add that menu to the sidebar.
Hope that helps.
Thank you
BrajeshHi Brajesh,
Thank you for your reply.
The links has the user name in it.
example: domain.com/members/USERNAME/activity
I was hoping i could get the whole profile menu + buddypress menu copy it in a widget or something.
I’m not really good at programming. LOLThank you and regards,
MMHi MM,
I am sorry but I don’t understand it.Can you please tell me what do you mean by this
The links has the user name in it.
example: domain.com/members/USERNAME/activity
I was hoping i could get the whole profile menu + buddypress menu copy it in a widget or something.Those are all BuddyPress Profile Links for the current logged in user.
Or do you mean that you need to have the sub nav too?Hi MM,
Please try this code in your bp-custom.php file and Let me Know if it works for you or not.
class BuddyDev_Display_User_Nav extends WP_Widget { public function __construct() { $widget_ops = array( 'description' => __( 'List of displayed user navigation menu', 'buddydev' ), ); parent::__construct( false, _x( 'Display User Navigation', 'widget name', 'buddydev' ), $widget_ops ); } public function widget( $args, $instance ) { $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ); echo $args['before_widget']; echo $args['before_title'] . $title . $args['after_title']; ?> <ul><?php bp_get_displayed_user_nav(); ?></ul> <?php } public function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); return $instance; } public function form( $instance ) { $default = array( 'title' => __( 'User Menu', 'bp-friend-request-widget' ), ); $instance = wp_parse_args( (array) $instance, $default ); $title = strip_tags( $instance['title'] ); ?> <p> <label for="<?php echo $this->get_field_id( 'title' ); ?>"> <?php _e( 'Title:' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%"/> </label> </p> <?php } } function buddydev_user_nav_widget() { register_widget( 'BuddyDev_Display_User_Nav' ); } add_action( 'bp_widgets_init', 'buddydev_user_nav_widget' );
Thank You
Ravi
You must be logged in to reply to this topic.