Hack Courseware Tabs

function cw_hack_tabs() {
  global $wp_filter;
  foreach ( reset( $wp_filter['courseware_group_nav_options'] ) as $k => $v ){
    $klass = reset( $v['function'] );
    $method = end( $v['function'] );
    if ( get_class( $klass ) == 'BPSP_Schedules' && $method == 'add_nav_options' )
      unset( $wp_filter['courseware_group_nav_options'][10][$k] );
  }
}
add_action('bp_groups_setup_nav', 'cw_hack_tabs');
Advertisements

Breadcrumb for post

function the_breadcrumb() {
		echo '<ul id="crumbs">';
	if (!is_home()) {
		echo '<li><a href="';
		echo home_url();
		echo '">';
		echo 'Home';
		echo "</a></li>";
		if (is_category() || is_single()) {
			echo '<li>';
			echo the_category();
			echo '</li>';
		} 
		elseif (is_search()) {
			echo '<li>Search Query for ';
			echo the_search_query();
			echo '</li>';
		}
		elseif (bp_is_user_activity() || bp_is_my_profile() || bp_is_page( BP_MEMBERS_SLUG ) || bp_is_group() || bp_is_page( BP_GROUPS_SLUG ) || bp_is_page( BP_ACTIVITY_SLUG ) || bp_is_page( BP_FORUMS_SLUG )) {
        jm_buddypress_breadcrumb();
		}
	}
	elseif (is_tag()) {single_tag_title();}
	elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo "<li>Blog Archives"; echo'</li>';}
	elseif (is_search()) {echo"<li>Search Results"; echo'</li>';}
	echo '</ul>';
}
function buddypress_breadcrumb() {
	global $bp;
$bp_user_link = $bp->loggedin_user->domain;
$bp_user_logout = wp_logout_url( bp_get_root_domain());
global $current_user;
get_currentuserinfo();

   if ( bp_is_my_profile() ) echo '<a href="'.SITE_URL.'/members/">Members</a>';
          if ( bp_is_page( BP_MEMBERS_SLUG ) && !bp_is_user()) echo '<a href="'.SITE_URL.'/members/">Members</a>';
          if ( bp_is_group() ) echo '<a href="'.SITE_URL.'/groups/">Groups</a>';
          if ( bp_is_page( BP_GROUPS_SLUG ) && !bp_is_group() ) echo '<a href="'.SITE_URL.'/groups/">Groups</a>';
          if ( bp_is_page( BP_ACTIVITY_SLUG ) ) echo '<a href="'.SITE_URL.'/activity/">Activity</a>';
          if ( bp_is_page( BP_FORUMS_SLUG )) echo '<a href="'.SITE_URL.'/forums/">Forums</a>';
          if ( bp_is_user_activity() ) echo '<a href="'.$bp_user_link.'">'.$current_user->display_name.'</a>';
}

Page Navigation for the posts

function pagination($pages = '', $range = 5)
{  
     $showitems = 5;  

     global $paged;
     if(empty($paged)) $paged = 1;

     if($pages == '')
     {
         global $wp_query;
         $pages = $wp_query->max_num_pages;
         if(!$pages)
         {
             $pages = 1;
         }
     }   

     if(1 != $pages)
     {
         echo "<div class='wp-pagenavi'>";
         echo "<span class='pages'>Page 1 of "; echo $pages; echo "</span>";
        
         if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>Prev</a>";

         for ($i=1; $i <= $pages; $i++)
         {
             if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))
             {
                 echo ($paged == $i)? "<span class='current'>".$i."</span>":"<a href='".get_pagenum_link($i)."' class='inactive' >".$i."</a>";
             }
         }

         if ($paged < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($paged + 1)."'>Next</a>";  
         
         echo "</div>\n";
     }
}

Call this in your posts archive to display the page navigation.