Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Need help setting up Private page (or posts) in user profile

@danbp

Participant

@durkk,

IMHO you do it overcomplicated.

Create a new page; call it “extra”
Create eventually a template for it. Basically, you made a copy of your theme “page.php”, you rename it “my-extra_page.php” and in the file header, you remove the original page comment and replace it with the new template comment.

/*
* Template name: my extra page
*/

Save !

Back to the page “extra” > edit and asign it the new template.

Now you can add a this page to each profile by using the abose snippet from the child-theme functions.php


function bpfr_my_setup_nav() {
    global $bp;
	
	$mytab=array(
	'name'            => 'My Tab',
	'link'      	  => 'permalink_to_your_page', // the one under the page title on page editor
	'slug'         	  => 'my-tab',
	'css_id'          => 'my_custom_tab',
	'position'        => 100,
	'user_has_access' => 1,
    'screen_function' => 'xprofile_screen_my_tab'
	);
	$bp->bp_options_nav['profile']['my-tab'] = $mytab; 	
}
add_action('bp_setup_nav', 'bpfr_my_setup_nav');

You can now add into this page template any code you want. To call a plugin, a specific content or what else.

To avoid this page to be shown in the menu bar, you can use this old plugin (it still works with 4.0)

To use a shortcode from within the text widget (this is not possible by default)
you can add this to your child-theme functions.php add_filter('widget_text', 'do_shortcode', 11);
Now you can use a shortcode in this widget !

Skip to toolbar