Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom page does not show

  • @trumpxie

    Participant

    Hi Guys,

    I am trying to add a new tab and related page in BuddyPress. The tab shows up fine but page it directs to always shows members rather than my custom page (though the URL is right e.g. localhost/members/jacob/myfav/). I am using WP 3.9.1 & BuddyPress 2.0.1. Below is my code in bp-custom.php. Could you please help?

    Thanks,
    Jacob

    
    function ms_bp_setup_nav() {
    
    	bp_core_new_nav_item(
    		array(
    			'name' => __( 'Favorites', 'buddypress' ),
    			'slug' => 'myfav',
    			'position' => 10,
    			'screen_function' => 'ms_bp_my_favorites',
    			'show_for_displayed_user' => true,
    			'item_css_id' => 'myfav'
    		)
    	);
    	
    }
    add_action('bp_setup_nav', 'ms_bp_setup_nav');
    
    function ms_bp_my_favorites(){
    
    	add_action( 'bp_template_title', 'ms_bp_my_fav_title' );
    	add_action( 'bp_template_content', 'ms_bp_my_fav_content' );
    	bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
    	
    }
    
    function ms_bp_my_fav_title() {
    	echo '<h2>My Favs</h2>';
    }
    
    function ms_bp_my_fav_content() {
    	echo '<h5>My Favs Content</h5>';
    }
    
  • The topic ‘Custom page does not show’ is closed to new replies.
Skip to toolbar