Do not use your own template files. Use plugins.php and hook your content.
function about_page() {
add_action( 'bp_template_title', 'about_page_show_screen_title' );
add_action( 'bp_template_content', 'about_page_show_screen_content' );
bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
}
function about_page_show_screen_title() {
echo 'About Page';
}
function about_page_show_screen_content() {
echo 'the content of the page';
}
@modemlooper And where would that file be located ? Should I make one in my theme ?
you can create a plugin for you extra code or us bp-custom.php
https://codex.buddypress.org/plugindev/bp-custom-php/
The contents of about.php go in the content function. There shouldn’t be a template file.
Hello Again,
I have done exactly what you sent above. I have deleted all codes from functions.php and put them in bp-custom.php files, located in the plugins folder.
Here are the contents of that file.
http://pastebin.com/X7eGp87V
Yet it always goes to the members page, the page where all members are listed 🙁
Here is the link if you want to look, click on About and you will see what’s happening.
http://tinyurl.com/m8y7zkm
I have already removed that and tried it.
bp_core_new_nav_item( array(
'name' => __( 'About', 'buddypress' ),
'slug' => 'about',
'position' => 30,
'screen_function' => 'about_page',
'css_id' => 'about'
) );
The thing is, no matter what I put, it keeps loading the “members” page in the about page
Try this, it worked for me!
function custom_setup_nav() {
global $bp;
bp_core_new_nav_item( array(
‘name’ => __( ‘About’, ‘buddypress’ ),
‘slug’ => ‘about’,
‘position’ => 30,
show_for_displayed_user’ => true,
‘default_subnav_slug’ => ‘about’,
‘item_css_id’ => ‘about’
) );
}
bp_core_new_subnav_item(
array( ‘name’ => __( ‘About’, ‘buddypress’ ),
‘slug’ => ‘about’,
‘parent_url’ => $bp->loggedin_user->domain . ‘about’,
‘screen_function’ => ‘about’,
‘parent_slug’ => ‘about’,
‘position’ => 10,
‘item_css_id’ => ‘about’
)
);
add_action( ‘bp_setup_nav’, ‘custom_setup_nav’ );
function about_page() {
add_action( ‘bp_template_content’, ‘about_content’ );
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/about’ ) );
}
function about_content(){
//Put your content here!
}
hi @patrick30, any luck with this? I am having the same issue