Forum Replies Created
-
Author
-
RicardoParticipant
All right, after many trial and errors, I got it! As example, moving the subnav “Favorites” to the last position:
COPY CODEfunction custom_bp_subnav_order() { global $bp; $domain = bp_displayed_user_domain() ? bp_displayed_user_domain() : bp_loggedin_user_domain(); bp_core_new_subnav_item( array( 'name' => _x( 'Favorites', 'Profile activity screen sub nav', 'buddypress' ), 'slug' => 'favorites', 'parent_url' => trailingslashit( $domain . bp_get_activity_slug() ), 'parent_slug' => bp_get_activity_slug(), 'screen_function' => 'bp_activity_screen_favorites', 'position' => 99, 'item_css_id' => 'activity-favs' ) ); } add_action( 'bp_setup_nav', 'custom_bp_subnav_order', 999 );
Add it to the child theme’s function.php.
Check function setup_nav() in /buddypress/bp-activity/bp-activity-loader.php to get the data for other subnav’s.
R.
RicardoParticipantThanks Laura, yes, I have previously seen this topic on Buddypress Forum, however, the only working solution provided on it is through editing the core code of Buddypress (specifically the function setup_nav()) in /buddypress/bp-activity/bp-activity-loader.php.
I wonder if there is a way to do this adding code to the theme’s function.php file.
R.
RicardoParticipantThis works to keep the right sidebar only on profile page.
COPY CODE//remove sidebar for activity and groups pages add_action('kleo_before_page','my_remove_sidebar'); function my_remove_sidebar() { if(!bp_is_member()) { remove_action('kleo_buddypress_after_content', 'kleo_buddypress_sidebar'); add_filter('kleo_buddypress_content_class', create_function('', 'return "twelve";')); } }
RicardoParticipantmmmm… Strange. The code looks logically fine but the member profile also had the right sidebar removed and turned full width… The intention is only activity and group pages full width. Any alternative for the “if” clause?
This is the function for now:
COPY CODE//remove right sidebar for activity and groups pages add_action('kleo_before_page','my_remove_sidebar'); function my_remove_sidebar() { if(bp_is_groups_component() || bp_is_activity_component()) { remove_action('kleo_buddypress_after_content', 'kleo_buddypress_sidebar'); add_filter('kleo_buddypress_content_class', create_function('', 'return "twelve";')); } }
RicardoParticipantIt doesn’t. I was looking at the code and found it out how to partially fix it.
I couldn’t fix the commented line:
COPY CODE//remove sidebar for activity and groups pages add_action('kleo_before_page','my_remove_sidebar'); function my_remove_sidebar() { if(bp_is_groups_component() || bp_is_activity_component()) { remove_action('kleo_buddypress_after_content', 'kleo_buddypress_sidebar'); //add_filter('kleo_content_class', create_function('', 'return "twelve";')); //this does not work } }
-
AuthorPosts