Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom profile menu – display content


  • barodscheff
    Participant

    @barodscheff

    Hi guys

    I’ve added a custom profile menu like told here: http://blog.maximusbusiness.com/2013/06/buddypress-profile-custom-bp-menu/

    The code is outdated. So I changed this function
    bp_core_load_template()

    to this
    bp_get_template_part

    It works so far and the template is included. But at the same time I get a 404 page and my included content is outside the content div. I would like to display the content of my template within the members/profile loop which is also not loaded.

    Any suggestions?

    The code:

    function my_setup_nav() {
          global $bp;
    
          bp_core_new_nav_item( 
    		array( 
                'name' => __( 'Item One', 'buddypress' ), 
                'slug' => 'my-item-one', 
                'position' => 30,
                'screen_function' => 'mb_author_posts', 
    		) 
    	  );
    
          // Change the order of menu items
          $bp->bp_nav['messages']['position'] = 100;
    }
    
    add_action( 'bp_setup_nav', 'my_setup_nav' );
    
    function mb_author_posts(){	
    	add_action( 'bp_template_content', 'mb_show_posts' );
    	bp_get_template_part( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
    }
    
    function mb_show_posts() {
        echo '<h1>Test</h1>';
    }
  • The topic ‘Custom profile menu – display content’ is closed to new replies.
Skip to toolbar