Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] New Page within Buddypress Profile


  • pare81
    Participant

    @pare81

    Hi Guys,

    I like to create a new page within the buddypress profile menu. This new Page should contain an shortcode to display some informations.

    How can I create an Menu-Item wich shows a page where this shortcode is included?

    I’ve got shown the link with the following code:

    function my_setup_nav() {
          global $bp;
    
          bp_core_new_nav_item( array( 
                'name' => __( 'My Page', 'buddypress' ), 
                'slug' => 'my-page', 
                'position' => 200, 
          ) );
    }
    
    add_action( 'bp_setup_nav', 'my_setup_nav' );

    How can I now get here an page linked?

    Thanks and regards
    Pare

Viewing 3 replies - 1 through 3 (of 3 total)

  • pare81
    Participant

    @pare81

    I’ve edited the code:

    function my_setup_nav() {
          global $bp;
    
          bp_core_new_nav_item( array( 
                'name' => __( 'My Page', 'buddypress' ), 
                'slug' => 'my-page', 
                'position' => 70,
    			'screen_function' => 'my_page_template'			
          ) );
    }
    
    add_action( 'bp_setup_nav', 'my_setup_nav' );
    
    function my_page_template() {
          bp_core_load_template( 'my-page-template.php' );
    }

    Where I have to safe the “my-page-template.php”? I use a wordpress childtheme with included folder buddypress. Do I have to write some special informations within the my-page-template.php or is it enough to insert the shortcode?

    actually the link from profile menu “my page” links to members overview page what not should be. it should linked to the my-page-template.php.

    thanks


    shanebp
    Moderator

    @shanebp

    Here’s an example

    Add a do_shortcode call to one of the ..._content functions.


    pare81
    Participant

    @pare81

    Hi Shanebp,

    thank you very much. Thats what I need.

    Wish you nice holidays.

    Regards
    pare

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] New Page within Buddypress Profile’ is closed to new replies.
Skip to toolbar