Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to code in new menu button

  • @gen-superman

    Participant

    Hey guys and gals,

    I am currently using the buddy press default member theme 1.0.1.

    http://buddypress.org/wp-content/themes/buddypress.org/images/theme-screens/default-theme.jpg

    also:

    WPMU 2.7.1

    BBPRESS 1.0

    BPPRESS 1.0.2

    I have been trying to edit the following files to edit the menu that appears typically under the logo of this theme, which says, “HOME,BLOG,MEMBERS,GROUPS,EVENTS,CONTENTS”.

    I want to add an existing newly created WPMU page called,”DONATE”, which the button will appear after the CONTENTS button, or for some, after the GROUPS button.

    The Page is not numbered, and the url looks something like:

    http://mywebsite.com/donate-page/

    *This is not a real website, just an example of the url structure.

    The files I have been trying to edit to add this new button that leads to that specific mentioned page is:

    wp-content>themes>bphome>index.php;header.php

    and

    wp-content>bp-themes>bpmember>index.php;header.php

    Once, I edit these files, I notice the codes toward the bottom, which are the menu navigational codes, but they point to something called “slugs”. It also seems to hook into these slugs in some fashion. But, I have no idea how it points to these things or where it is pointing from?

    So, an example of the code might look like from header.php file:

    <?php if ( function_exists( ‘groups_install’ ) ) { ?>

    <li<?php if ( bp_is_page( BP_GROUPS_SLUG ) ) {?> class=”selected”<?php } ?>>/<?php echo BP_GROUPS_SLUG ?>” title=”<?php _e( ‘Groups’, ‘buddypress’ ) ?>”><?php _e( ‘Groups’, ‘buddypress’ ) ?>

    So, how do I incorporate a link into a slug, or how do I create a slug? or what do I change or add after this code to get my own menu button that points to the donate page I mentioned above. I created the page through WPMU create page in the admin dashboard.

    What files do I edit to make this work, and can anyone please tell me the codes that I input to make this work?

    Thanks so much for anyones help in this matter, it is truly appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • @burtadsit

    Participant

    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.

    Inactive

    holy crap, so what happens when i want to add a page like http://www.trination.co.cc/store like that and the page is made in wordpress?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to code in new menu button’ is closed to new replies.
Skip to toolbar