New
PeoplePress is here. Community building for WordPress, reimagined. Fast, modern, and built for the communities you've always wanted to run.
See it live

BuddyDev

Search

Custom Profile Group doesn’t show when logged out

  • Participant
    Level: Enlightened
    Posts: 23
    Philip Strothmann on #7618

    Hey @sbrajesh,

    any idea on what is causing my issue by any chance? 🙂

    Kind regards,
    Philip

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    Brajesh Singh on #7629

    Hi Phillip,
    My apologies for missing the topic. Please allow me to get back to you a little late today or early tomorrow.

    Thank you
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 23
    Philip Strothmann on #7657

    Hey Brajesh,

    no problem. Have you had a chance to look at the issue? 🙂

    Kind regards,
    Philip

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    Brajesh Singh on #7728

    Hi Phillip,
    I just tested the code.

    I used this section from the above code

    
    
    //step 1: Add a new Tab
    function buddydev_setup_new_xprofile_tab() {
    
    	$slug = bp_get_profile_slug();
    
    	bp_core_new_subnav_item( array(
    		'name'          => 'About',//label
    		'slug'          => 'about',//slug
    		'parent_slug'   => $slug,
    		'position'      => 12,
    		'parent_url'    => trailingslashit( bp_loggedin_user_domain() . $slug )  ,
    		'screen_function' => 'buddydev_screen_profile_data'
    	));
    }
    
    add_action( 'bp_setup_nav', 'buddydev_setup_new_xprofile_tab' );
    
    //Step 2: Load the plugins template file
    function buddydev_screen_profile_data() {
    	//filter loop
    	add_filter( 'bp_after_has_profile_parse_args', 'buddydev_filter_args_for_profile_group' );
    	//load loop
    	add_action( 'bp_template_content', 'buddydev_show_profile_group_data');
    
    	bp_core_load_template( 'members/single/plugins');
    }
    
    function buddydev_modifyy_user_profile_tab() {
    
    	bp_core_new_nav_item( array(
    		'name'	=> 'Critical Review',
    		'slug'	=> 'criticalreview',
    		'screen_function'	=> 'buddydev_screen_profile_data',
    		'default_subnav_slug' => 'criticalreview-sub',
    		'show_for_displayed_user' => true,
    ));
    
    }
    add_action( 'bp_setup_nav', 'buddydev_modifyy_user_profile_tab', 8 );
    
    function buddydev_filter_args_for_profile_group( $args ) {
    	///CHANGE IT
    	$args['profile_group_id']  = 2; //Your Profile Group ID Here
    
    	return $args;
    }
    //Load the loop
    function buddydev_show_profile_group_data() {
    
    	bp_get_template_part( 'members/single/profile/profile-loop' );
    }
    

    It is working fine for on BuddyPress 2.8 for the logged ion user’s profile as well as other user’s profile.

    I am sorry but I am not sure of the problem.

You must be logged in to reply to this topic.

This topic is: not resolved