Skip to:
Content
Pages
Categories
Search
Top
Bottom

Create link to logged-in member profile page?

  • @richardmiller-1

    Participant

    I’m using BuddyPress in a limited way in conjunction with BBPress.

    Looking for code or a URL I can add to my BBPress forum template that will take users to their own BuddyPress profile page.

    http://fluentself.com/forums
    WP 4.8.2
    BBPress 2.5.13

Viewing 6 replies - 1 through 6 (of 6 total)
  • @boonebgorges

    Keymaster

    I think you want something like this:

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

    @richardmiller-1

    Participant

    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?

    @richardmiller-1

    Participant

    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

    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

    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.

    @richardmiller-1

    Participant

    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