Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding a new nav item


  • LambrosPhotios
    Participant

    @lambrosphotios

    Hi, I’ve added a new nav item using the following:

    add_action( 'bp_setup_nav', 'test_board', 100 );
     
    function test_board() {
    	global $bp;
     
    	bp_core_new_nav_item( array(
    		'name' => 'Test Board',
    		'slug' => 'test-board',
    		'screen_function' => 'bpis_profile',
    		'position' => 10
    		)
    	);
    }
    
    function bpis_profile () {
    	echo do_shortcode('[bpis_tags]');
    	echo do_shortcode('[bpis_images]');
    }
    

    The issue is that when I click on this link in the BP nav bar, it outputs the shortcodes (as per the bpis_profile function) outside of any divs (meaning it just appears at the top of the website, outside of the theme). In addition, the nav bar disappears and I receive the “About” page of the user I am currently viewing (which shows subscribed forum topics, favorite forum topics, etc).

    Is there any workaround for this? Ideally, I’d like my shortcodes to output in the body region, beneath the BP nav bar (which has currently disappeared).

    Thank you!

  • The topic ‘Adding a new nav item’ is closed to new replies.
Skip to toolbar