Skip to:
Content
Pages
Categories
Search
Top
Bottom

Linking to bbpress profile (need help please)

  • @blognerd

    Participant

    Hi everyone,

    Hope someone can help me out with this, I’ve been searching around for several days and I can’t seem to find a solution.

    I’m using bbpress (obviously) on my 3.5.1 WP install. I have code in a fixed header that allows my users to login to the website. Here’s the code I have in my header.php

    display_name.’ | ‘, wp_loginout(); } else { ?>
    or <a href="/wp-login.php?action=register”>Join

    Basically this generates Login | Join when the user is not logged in and username | logout when they are logged in.

    My question is this, when a user is logged in I’d like to have the username link directly to their bbpress profile. For the life of me I can’t find any info on how I would do this.

    Does anyone have any info or could point me in the right direction so I can could get this done? Maybe it’s not even possible?

    Thanks to anyone who can help.

    Cheers.

Viewing 4 replies - 1 through 4 (of 4 total)
  • @blognerd

    Participant

    Sorry guys, I didn’t think that the code wouldn’t post properly.

    @netweb

    Keymaster

    I’d suggest taking a look at the code in the bbPress ‘Login Widget’ included with bbPress.

    It behaves in very much the same way you are looking to have in your header.

    What you are probably after starts at line #137 and depending on your needs use either `bbp_user_profile_url( bbp_get_current_user_id() )` or `bbp_user_profile_link( bbp_get_current_user_id() )`

    @blognerd

    Participant

    Thanks Stephen, going to give that a shot.

    @blognerd

    Participant

    You steered me right Stephen, here’s what I ended up with:

    `display_name.’ | ‘, wp_loginout(); } else { ?>`
    ` or <a href="/wp-login.php?action=register”>Join`

    This gives me everything I needed.

    If user is not logged in they get Login or Join
    If they are logged in they get username (linked to profile) | Logout

    Thanks for the help.

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