This topic has 4 replies, 2 voices, and was last updated 9 years by Laura.

  • Author
  • #56401
     Ricardo
    Participant

    I’ve persistently been in the web in search of a function to reorder the activity subnav (Personal, Mentions Favorites, Friends, Groups) and I could not find any that works, even on Buddypress forum. I would be grateful if you help me to find a solution for this.

    #56953
     Laura
    Moderator

    Hello, please check out https://buddypress.org/support/topic/re-order-subnav-tabs-in-profile-page/ let me know if its helpfull 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #56976
     Ricardo
    Participant

    Thanks 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.

    #56990
     Ricardo
    Participant

    All right, after many trial and errors, I got it! As example, moving the subnav “Favorites” to the last position:

    COPY CODE
    
    function 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.

    #57201
     Laura
    Moderator

    Awesome! 😀

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?