Skip to:
Content
Pages
Categories
Search
Top
Bottom

Create link to logged-in member profile page?

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

  • Boone Gorges
    Keymaster

    @boonebgorges

    I think you want something like this:

    
    $user_id = bp_loggedin_user_id();
    $user_profile_url = bp_core_get_user_domain( $user_id );
    

    richard.miller
    Participant

    @richardmiller-1

    Thanks for this, sorry for the delay – I don’t get email replies for this forum.

    So … this is code I would paste somewhere in my default BBPress template (I have one called bbpress.php)?

    If so, where should it go?


    richard.miller
    Participant

    @richardmiller-1

    I added this code to the bbpress.php template:

    <?php
    $user_id = bp_loggedin_user_id();
    $user_profile_url = bp_core_get_user_domain( $user_id );
    ?>

    Nothing showed up on the page.

    May I request more guidance, please?


    peter-hamilton
    Participant

    @peter-hamilton

    So you want a link to logged in users profiles, clarify where this link should be…in the header?
    You should make a child-theme and add some code to a new header.php.

    <li><a href="<?php echo bp_loggedin_user_domain(); ?>" class="profilelink" title="My Profile">Profile</a></li>

    You must place this code just before the </nav> code, or at any spot in the header you wish.

    Thisprobably means you need to learn how to make a child-theme in wordpress first, very important.


    peter-hamilton
    Participant

    @peter-hamilton

    Ofcourse you could also go to…

    dashboard > settings > menus

    And select “profile” from the “buddypress” menu options on the left, if you do not see any buddypress links you should click the “screen options” on right top of page and select buddypress.


    richard.miller
    Participant

    @richardmiller-1

    That code snippet was exactly what I needed – thank you!

    (and of course I have a child theme, very good advice)

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar