Forum Replies Created
-
Hi Shane,
Thanks for the quick reply and it actually worked! Thank you 🙂
The sidebar shows for a specific user type now but it shows up in the wrong location. I tried the code in different places but it’s in the middle of the profile now and want it to be on the left side like the normal sidebar for user profile.
The first part of the code is the simplified version you mentioned and the css styling. The rest is the remaining of the loop on that page. I suppose the code should go somewhere in there:
</div><!-- #item-body --> <?php $member_type = bp_get_member_type( bp_displayed_user_id() ); if ( $member_type == 'club' ) {?> <div id="secondary" class="widget-area sm-grid-1-1 no-padding-top" role="complementary"> <div class="bb-sticky-sidebar"> <?php dynamic_sidebar( 'club_sidebar'); ?> </div> </div> <?php } ?> <?php if ( ( !isset($bp_nouveau_appearance['user_nav_display']) || !$bp_nouveau_appearance['user_nav_display'] ) && is_active_sidebar('user_activity') && bp_is_user_activity() ) { ob_start(); dynamic_sidebar('user_activity' ); $sidebar = ob_get_clean(); // get the contents of the buffer and turn it off. if ( trim( $sidebar ) ) { ?> <div id="user-activity" class="widget-area" role="complementary"> <div class="bb-sticky-sidebar"> <?php dynamic_sidebar( 'user_activity' ); ?> </div> </div><?php } } if ( ( !isset($bp_nouveau_appearance['user_nav_display']) || !$bp_nouveau_appearance['user_nav_display'] ) && is_active_sidebar( 'profile' ) && !bp_is_user_settings() && !bp_is_user_messages() && !bp_is_user_notifications() && !bp_is_user_profile_edit() && !bp_is_user_change_avatar() && !bp_is_user_change_cover_image() && !bp_is_user_front() && $profile_cover_width == 'full' ) { ob_start(); dynamic_sidebar('profile' ); $sidebar = ob_get_clean(); // get the contents of the buffer and turn it off. if ( trim( $sidebar ) ) { ?> <div id="secondary" class="widget-area sm-grid-1-1 no-padding-top" role="complementary"> <div class="bb-sticky-sidebar"> <?php dynamic_sidebar( 'profile'); ?> </div> </div> <?php } } ?> </div> </div><!-- // .bp-wrap --> <?php if ( isset($bp_nouveau_appearance['user_nav_display']) && $bp_nouveau_appearance['user_nav_display'] && is_active_sidebar( 'profile' ) && !bp_is_user_settings() && !bp_is_user_messages() && !bp_is_user_notifications() && !bp_is_user_profile_edit() && !bp_is_user_change_avatar() && !bp_is_user_change_cover_image() && !bp_is_user_front() && $profile_cover_width != 'default' ) { ?> </div> <?php ob_start(); dynamic_sidebar('profile' ); $sidebar = ob_get_clean(); // get the contents of the buffer and turn it off. if ( trim( $sidebar ) ) { ?> <div id="secondary" class="widget-area sm-grid-1-1 no-padding-top" role="complementary"> <div class="bb-sticky-sidebar"> <?php dynamic_sidebar( 'profile'); ?> </div> </div> <?php } ?>
This is a screenshot of where the sidebar is appearing:
Certificates is in the middle. How can it be in the place of cart?
-How can I move the sidebar (Certificates) to where the left sidebar (Cart) is?
-And how can I repeat this process for 3 different user types? 3 custom sidebars for 3 user types.
-I was not sure what “ob_start()” and “bp_nouveau_appearance” were that appear in the beginning of the other sidebar code. How can I add them to the custom sidebar? Are they even necessary?
Appreciate the support and the community around BuddyPress