Need help with the BuddyPress menu.

I added some code provided by one of your support people that allows me to add a custom menu item to the BuddyPress profile menu titled "Write Blog". It worked and so I duplicated it to added another one called "My Posts". Currently, this is what is seen when you click on the tab "My Posts"

Instead of what is currently shown, I would like it to default to the "posts" tab that uses the URL:

But the link is relative to the user. The slug will vary according to the username. So if my username is "joshua" it will be /members/joshua/my-posts/?section=posts. Basically, the end is what matters. /?section=posts

Please help how can I achieve that.

  • Ash
    • WordPress Hacker

    Hello Joshua

    The simplest way is to use javascript. In your other post, remember the last function - bp_custom_write_blog_cb()?

    Make some changes in that function like following:

    function bp_custom_write_blog_cb() {
    	echo 'Text or shortcode for this tab';
    	if( ! isset( $_REQUEST['section'] ) ) {
    			window.location.href = window.location + '?section=posts';

    Let me know if it works for you. Have a nice day!


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.