Create Blog link next to sites>My Sites
-
Hi, please can you help me with a code to create the “create site” link under sites> next to “My sites” in buddypress member profile area.
right now I can only see it under site.com/blog
http://www.site.com/blogs/create/
I was able to modify the code in bp-blogs-loader.php however
I don’t know how to create the link to create my site ‘slug’ => ‘create-your-sites’,to http://www.site.com/blogs/create/
below is an example coder.
Also how to add it in bp-custom to work, thank you
/**
* Setup BuddyBar navigation
*
* @global BuddyPress $bp The one true BuddyPress instance
*/
function setup_nav() {
global $bp;/**
* Blog/post/comment menus should not appear on single WordPress setups.
* Although comments and posts made by users will still show on their
* activity stream.
*/
if ( !is_multisite() )
return false;$sub_nav = array();
// Add ‘Sites’ to the main navigation
$main_nav = array(
‘name’ => sprintf( __( ‘Sites %d‘, ‘buddypress’ ), bp_blogs_total_blogs_for_user() ),
‘slug’ => $this->slug,
‘position’ => 30,
‘screen_function’ => ‘bp_blogs_screen_my_blogs’,
‘default_subnav_slug’ => ‘my-sites’,
‘item_css_id’ => $this->id
);$parent_url = trailingslashit( bp_displayed_user_domain() . bp_get_blogs_slug() );
$sub_nav[] = array(
‘name’ => __( ‘My Sites’, ‘buddypress’ ),
‘slug’ => ‘my-sites’,
‘parent_url’ => $parent_url,
‘parent_slug’ => $bp->blogs->slug,
‘screen_function’ => ‘bp_blogs_screen_my_blogs’,
‘position’ => 10
);$sub_nav[] = array(
‘name’ => __( ‘Create Site’, ‘buddypress’ ),
‘slug’ => ‘your-sites’,
‘parent_url’ => $parent_url,
‘parent_slug’ => $bp->blogs->slug,
‘screen_function’ => ‘bp_blogs_screen_my_blogs’,
‘position’ => 50
);// Setup navigation
parent::setup_nav( $main_nav, $sub_nav );
}
- The topic ‘Create Blog link next to sites>My Sites’ is closed to new replies.