I think you want something like this:
$user_id = bp_loggedin_user_id();
$user_profile_url = bp_core_get_user_domain( $user_id );
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?
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?
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.
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.
That code snippet was exactly what I needed – thank you!
(and of course I have a child theme, very good advice)