'home' , 'desc' => __( 'Home', 'buddypress' ), 'fun' => false), 0 => array('slug' => constant('BP_HOME_BLOG_SLUG') , 'desc' => __( 'Blog', 'buddypress' ), 'fun' => false), 1 => array('slug' => constant('BP_MEMBERS_SLUG') , 'desc' => __( 'Members', 'buddypress' ), 'fun' => false), 2 => array('slug' => constant('BP_GROUPS_SLUG') , 'desc' => __( 'Groups', 'buddypress' ), 'fun' => 'groups_install'), 4 => array('slug' => constant('BP_BLOGS_SLUG') , 'desc' => __( 'Blogs', 'buddypress' ), 'fun' => 'bp_blogs_install') ); if( function_exists( 'bp_forums_setup' ) && !(int) get_site_option( 'bp-disable-forum-directory' ) ) { $bp_items[3] = array('slug' => constant('BP_FORUMS_SLUG') , 'desc' => __( 'Forums', 'buddypress' ), 'fun' => 'groups_install'); ksort( $bp_items ); } $before = ''; $home = get_option('home'); foreach($bp_items as $item) { if(!$item['fun'] || function_exists($item['fun'])) { $before .= '
  • ' . $item['desc'] . "
  • \n"; } } $index = strpos($menu, '')) > 0) { $index += $index2 + 1; $menu = substr($menu, 0, $index) . $before . substr($menu, $index); } } return $menu; } add_filter('wp_page_menu','thematic_bp_site_nav'); function thematic_show_home_blog() { global $bp, $query_string, $paged; if (thematic_have_bp() && thematic_is_bp_home()) { if ( $bp->current_component == BP_HOME_BLOG_SLUG && ( !$bp->current_action || 'page' == $bp->current_action ) ) { unset( $query_string ); if ( ( 'page' == $bp->current_action && $bp->action_variables[0] ) && false === strpos( $query_string, 'paged' ) ) { $query_string .= '&paged=' . $bp->action_variables[0]; $paged = $bp->action_variables[0]; } query_posts($query_string); bp_core_load_template( 'index', true ); } } } add_action( 'wp', 'thematic_show_home_blog', 2 ); /* Load the BP AJAX functions for the theme */ require_once( TEMPLATEPATH . '/_inc/ajax.php' ); /* Load the javascript for the theme */ wp_enqueue_script( 'jquery-livequery-pack', get_template_directory_uri() . '/_inc/js/jquery-livequery.js', array( 'jquery' ) ); wp_enqueue_script( 'dtheme-ajax-js', get_template_directory_uri() . '/_inc/js/ajax.js', array( 'jquery', 'jquery-livequery-pack' ) ); function thematic_add_bp_ajax() { if( !thematic_have_bp() || !thematic_is_bp_home() ) { wp_deregister_script( 'jquery-livequery-pack' ); wp_deregister_script( 'dtheme-ajax-js' ); } } add_action( 'wp_head', 'thematic_add_bp_ajax', 1 ); // is the buddypress admin bar active function thematic_no_bp_adminbar() { return defined('BP_DISABLE_ADMIN_BAR'); } // are we the buddypress home blog function thematic_is_bp_home() { global $current_blog; return (defined( 'BP_ENABLE_MULTIBLOG' ) || (defined('BP_ROOT_BLOG') && $current_blog->blog_id == constant('BP_ROOT_BLOG'))); } // is bp running function thematic_have_bp() { global $bp; return isset($bp); } ?>