Skip to:
Content
Pages
Categories
Search
Top
Bottom

Not load template on custom profile page


  • Gromozeka
    Participant

    @gromozeka

    I added a custom menu item. But when i try loading the custom template when custom page opens on member profile. I use this code

    function bp_gf_ua_profile_nav_add()
    {
        bp_core_new_nav_item(
            array(
                'name' => __('Email preferences', 'buddypress'),
                'slug' => 'email-preferences',
                'position' => 3,
                'show_for_displayed_user' => true,
                'screen_function' => 'bp_gf_ua_profile_load_template',
                'item_css_id' => 'all-conversations'
            )
        );
    }
    
    function mb_show_posts2() {
        echo "Test Text";
    }
    
    function bp_gf_ua_profile_load_template()
    {
        add_action( 'bp_template_content', 'mb_show_posts2' );
        bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/email-preferences/preferences' ));
    }
    
    add_action( 'bp_setup_nav', 'bp_gf_ua_profile_nav_add' );

    But always display memeber-loop template. What i doing wrong?

    Thanks!

  • The topic ‘Not load template on custom profile page’ is closed to new replies.
Skip to toolbar