Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] How to create a dynamic link to "my profile"


  • Florence
    Participant

    @floortjahh

    I found a few topics about creating a my profile link in the menu. I just want a regular text link though. Is it possible to write in HTML?

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

  • danbpfr
    Participant

    @chouf1

    ``< a href ="hxxp://example.com/members/MEMBER_NAME">MyProfile</a>`` ?


    Florence
    Participant

    @floortjahh

    Hi, thanks for your response. That doesn’t work, although that is the kind of solution I’m looking for. I guess it can’t be done without some PHP coding. Could someone explain how to achieve this to me in newb terms? I know a little bit about coding, and I’d be able to put some PHP into my post /page content using a plugin, I just wouldn’t know what to write. Any help would be greatly appreciated 🙂 Thanks!


    modemlooper
    Moderator

    @modemlooper

    `<a href=”<?php echo bp_loggedin_user_domain(); ?>”>Profile</a>`


    Florence
    Participant

    @floortjahh

    Thank you kindly, that worked perfectly!


    Eric Langley
    Participant

    @elangley

    @modemlooper,

    I have the same need but snippet did not work for me. I am running Running BP 1.81.

    The link goes to //sample-page/”<?php


    bp-help
    Participant

    @bphelp

    @elangley
    if:

    
    <a href="<?php echo bp_loggedin_user_domain(); ?>">Profile</a>
    

    Didn’t work for you the try:

    
    <a href="<?php global $current_user; echo home_url() . '/members/' . $current_user->user_login . '/profile/'; ?>">Profile</a>
    

    Not tested!


    Trishan1000
    Participant

    @trishan1000

    hi @modemlooper can you please explain how i should use the code you mentioned?
    <a href=”<?php echo bp_loggedin_user_domain(); ?>”>Profile</a>

    @trishan1000 — you’d need to put that into a PHP template file in your theme, wherever you need it.

    I’m going to close this topic as it’s about 4 months old and it’s best to create a new topic if you have a new question. Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] How to create a dynamic link to "my profile"’ is closed to new replies.
Skip to toolbar