Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] How to make a link show on your profile alone but not while viewing friends profile

  • Hi, please can someone help me out, i have a link to Edit Profile. i put the code in members-header.php. but the problem is that the link show even while you are viewing your friends profile. so how can i make it show only on your own profile but not on friends

    The code am using is :
    `<a class="edit-my"<a href="profile/edit”>Edit Profile`

    I mean how can i wrap the code to declare something like if is_ user_profile

    Regards

Viewing 9 replies - 1 through 9 (of 9 total)
  • Avatar of shanebpdev
    shanebp
    Participant

    @shanebp

    if ( bp_is_my_profile() )

    @shanebp, thanks for your input. i use the code like :

    `<a class="edit-my"<a href="profile/edit”>Edit Profile`

    but the link still show while viewing friends profile. am using the code in a correct way or what am i doing wrong.

    Regards

    Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    @naijaping you almost got it. Delete extra`<a` and add `;` after the `()`'s

    `
    <a class="edit-my" href="profile/edit/” >Edit Profile
    `

    @mercime, i am not sure if this code can be use in memers-header.php. i use the code as you said but still same thing. the link still show while viewing friends profile.

    Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    @naijaping as site admin, you will see the link. Clear cache and check it while using a regular member account.

    @mercime, that did not help, i am currently using your code, i clear the cache and login as a regular member but the link is still there while you are not on your profile. the code show the link but not while on your own profile alone even when you are viewing friends profile it still show. i dont know what do do again.

    Regards

    Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    @naijaping Here’s how/where I posted the code
    `

    <a href="”>

    @

    <a class="edit-my" href="profile/edit/” >Edit Profile

    `

    @mercime , just to let you know that i just test your first code on another server and it worked like a charm. the problem is from the other server.

    Thanks so much for your time.

    Thumbs up.

    Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    You’re welcome. Thumbs up to you too for your persistence :-)

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

You must be logged in to reply to this topic.