Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to add new top buttons ??

  • Avatar of Halfpint
    halfpint
    Participant

    @halfpint

    Hi I am trying to add a new button on the members theme, Where you have “Home” “Blog” “Members” “Groups” “Blogs” at the top of the members theme.

    I am trying to add another button for the forum which I installed but I dont know where abouts to add the code or how the buttons are actually generated as I can not find any image that is used for the top buttons. Any help appreciated

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Avatar of wpmubp.org
    wpmubp
    Participant

    @takuya

    There’s no image used. Only CSS. Check out header.php of the template file.

    Avatar of Halfpint
    halfpint
    Participant

    @halfpint

    Thanks… OOH I hate CSS :)

    Avatar of Halfpint
    halfpint
    Participant

    @halfpint

    Is this the code to one of the top buttons you mean in the header.php

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

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

    <?php } ?>

    Avatar of Halfpint
    halfpint
    Participant

    @halfpint

    I still cant get this to work I have installed simple forums and want a link/ button to show up in the top members theme so they can go straight to the forum when the members are logged in

    thanks

    Avatar of Gordon Bunker
    mypop
    Participant

    @mypop

    This is how I did it.

    I modified header.php in the buddypress theme AND the member theme.

    There is probably a better way since the forums location is included as part of the integration, however it works, and you can use this principle to include a hard coded link to anywhere.

    Find the bit of code that starts <div id="header">

    The first bit is the routine to run the blogs page, the second opens up bbPress in a seperate tab.

    `<?php if ( function_exists( ‘bp_blogs_install’ ) ) { ?>

    <li<?php if ( bp_is_page( BP_BLOGS_SLUG ) ) {?> class=”selected”<?php } ?>><a href=”<?php echo get_option(‘home’) ?>/<?php echo BP_BLOGS_SLUG ?>” title=”<?php _e( ‘Blogs’, ‘buddypress’ ) ?>”><?php _e( ‘Blogs’, ‘buddypress’ ) ?></a></li>

    <?php } ?>

    <li><a href=”http://www.mypartyonparty.biz/forums” target=”_blank” title=”<?php _e( ‘Support’, ‘buddypress’ ) ?>”><?php _e( ‘Support’, ‘buddypress’ ) ?></a></li>

    <?php do_action( ‘bp_nav_items’ ); ?>`

    What I’d like to do is present the forums in the same way that is done on here (BuddyPress.org, ) that just needs a bit of thinking about…

    Hope that helps

    Avatar of Halfpint
    halfpint
    Participant

    @halfpint

    Thanks Gorden I will play around with it now I know where to look :)

    Avatar of Halfpint
    halfpint
    Participant

    @halfpint

    Thanks Gorden that worked a treat for me :)

    Avatar of Erwin Gerrits
    Erwin Gerrits
    Participant

    @egerrits

    All you have to do is create a php file called “add_forum_to_menu.php” with the following code:

    <?php
    function add_forums_to_main_menu() {

    $class = (bp_is_page('forums')) ? ' class="selected" ' : '';

    echo '<li ' . $class. '><a href="' . get_option('home') . '/forums"
    title="' . __( 'Forums', 'buddypress' ) .'">' .
    __( 'Forums', 'buddypress' ) .'</a></li>';

    }

    add_action('bp_nav_items','add_forums_to_main_menu');
    ?>

    and put it in the mu-plugins directory. Make sure the “/forums” path in the above code points to your forum directory (mine is at http://www.domain.com/forums)

    Avatar of John James Jacoby
    John James Jacoby
    Keymaster

    @johnjamesjacoby

    The only potential draw back with that method Erwin, is that it adds the link at the end of the assembled navigation instead of giving you total control over it.

    Something to think about, is that BuddyPress really does allow for per-theme blog setups.

    The difference between:

    http://delsolownersclub.com/

    and

    http://delsolownersclub.com/news/

    and

    http://delsolownersclub.com/mafdark/

    Are all just smoke and mirrors with different themes.

    You could really make any ‘blog’ of your website do whatever you want it to do, just like how the BuddyPress Codex is really just another blog. ;)

    Morpheus: “Do you think that’s air you’re breathing now?”

Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.