Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add links into menu


  • ant60
    Member

    @ant60

    Hi!

    I am french so I apologize for my bad english.

    I use BuddyPress, a great script and I care for congratulate the creator.

    I have one question about the insertion of links in the top menu. I want add a link “My profil”. For example : http://www.website.net/blog/members/admin/. So, I need a variable for each user. I find “$bp->displayed_user->fullname”. But when I want to display it in my menu, there is nothing… I specify that I put the variable in “header.php”.

    What is the solution?

    Thanks a lot.

    PS : Is my english good ?! :p

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

  • ant60
    Member

    @ant60

    any ideas?


    @mercime
    Keymaster

    @mercime

    Hi ant60 – just to clarify, do you mean you want logged-in user’s link to his/her profile page appear in your navigation menu? If so, you can add this code

    `<?php if ( is_user_logged_in() ) : ?>

    <li><a href=”<?php echo bp_loggedin_user_domain() ?>”></li>

    <?php endif; ?>`

    to your theme’s header.php file within

    <ul id="nav">
    <li<?php if ( bp_is_front_page() ) : ?> class="selected"<?php endif; ?>>
    <a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?></a>
    </li>
    <?php wp_list_pages( 'title_li=&depth=1&exclude=' . bp_dtheme_page_on_front() ); ?>
    <?php do_action( 'bp_nav_items' ); ?>
    </ul><!-- #nav -->


    modemlooper
    Moderator

    @modemlooper

    <?php if ( is_user_logged_in() ) : ?>
    <li><a href="<?php echo bp_loggedin_user_domain() ?>">Profile</a></li>
    <?php endif; ?>


    @mercime
    Keymaster

    @mercime

    Thanks for the correction, Modemlooper :-)

    alternatively, one could use

    <?php if ( is_user_logged_in() ) : ?>
    <li><?php bp_loggedinuser_link() ?></li>
    <?php endif; ?>

    which was what I was thinking of in the first place :-O


    ant60
    Member

    @ant60

    Thanks a lot.

    Your solution works.

    But, I installed the plugin “BuddyPress Album +” and I want also make a link to “My Pictures”.

    The link is : “http://www.forum-twilight.net/blog/members/MEMBER NAME/album/”

    Any ideas?

    Thanks a lot


    ant60
    Member

    @ant60

    It”s ok.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Add links into menu’ is closed to new replies.
Skip to toolbar