Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom "my profile" link in header


  • mighty_fox
    Participant

    @mighty_fox

    I am using BBPress and in the header I have created an login/logout section for when a guest or user is logged in. I’m currently trying to create a “My Profile” link when a user is logged in but I’m unsure of the functions to achieve this (or if I am using the right functions currently). My code for this currently is:

    if(is_user_logged_in()) {
    global $current_user;
    get_currentuserinfo(); $text .= 'Hi '.$current_user->display_name.'!';
    echo $text;
    echo "#"'>My Profile | Logout"; }
    else{echo "You are currently not logged in!";
    echo "Register |
    Log in"; }

    • This topic was modified 7 months ago by  mighty_fox.
    • This topic was modified 7 months ago by  mighty_fox.
Viewing 2 replies - 1 through 2 (of 2 total)

  • zaerl
    Participant

    @zaerl

    bbp_user_profile_link( $user_id = 0 ) for the link, bbp_get_user_profile_url( $user_id = 0 ) for the URL.


    mighty_fox
    Participant

    @mighty_fox

    Thank you :)

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

You must be logged in to reply to this topic.