Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How to code in new menu button


Burt Adsit
Participant

@burtadsit

I don’t really understand what all that above is at all. If you are trying to add a new nav item to the member and bp home themes then you need to do something similar to the following:

function oci_bpc_nav_item(){
?>
<li<?php if ( bp_is_page( OCI_CONTENTS_SLUG ) ) {?> class="selected"<?php } ?>>
<a href="<?php echo bp_core_get_root_domain() ?>/<?php echo OCI_CONTENTS_SLUG ?>
" title="<?php _e( 'Contents', 'bpcontents' ) ?>">
<?php _e( 'Contents', 'bpcontents' ) ?></a></li>
<?php
}
add_action('bp_nav_items', 'oci_bpc_nav_item');

That’s the way bpc hooks the action ‘bp_nav_items’ that header.php generates after displaying the default nav items. Your ‘Event’ and ‘Content’ items are displayed that way. You need to define a function that responds to ‘bp_nav_items’ and generate the appropriate html for the button.

Skip to toolbar