Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: BP 1.2: How to add a custom tab on the Home activity section

Looks good, but you don’t need to copy the template. Just add this function in your child theme’s functions.php file (or wherever you put the other code):

function my_theme_add_activity_tab() {
if ( !is_user_logged_in() )
return false;
?>
<li id="activity-myclass">
<a href="<?php echo site_url( BP_ACTIVITY_SLUG . '/#myclass/' ) ?>" title="<?php _e( 'Activity for my Class Year.', 'buddypress' ) ?>">
<?php printf( __( 'My Class', 'buddypress' ) ) ?>
</a>
</li>
<?php
}
add_action( 'bp_activity_type_tabs', 'my_theme_add_activity_tab' );

Skip to toolbar